Skip to content

Commit

Permalink
Do not clear odh stuff when continuous suite running (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornys authored Dec 7, 2023
1 parent a224ed5 commit 0b65b8e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/main/java/io/odh/test/framework/OdhResourceCleaner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright Skodjob authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.odh.test.framework;

import io.odh.test.platform.KubeUtils;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class OdhResourceCleaner implements AfterAllCallback {

static final Logger LOGGER = LoggerFactory.getLogger(OdhResourceCleaner.class);

static final String SEPARATOR_CHAR = "#";

@Override
public void afterAll(ExtensionContext extensionContext) {
KubeUtils.clearOdhCRDs();
}
}
2 changes: 0 additions & 2 deletions src/main/java/io/odh/test/framework/TestCallbackListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package io.odh.test.framework;

import io.odh.test.framework.manager.ResourceManager;
import io.odh.test.platform.KubeUtils;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
Expand Down Expand Up @@ -42,7 +41,6 @@ public void beforeEach(ExtensionContext extensionContext) throws Exception {
public void afterAll(ExtensionContext extensionContext) throws Exception {
ResourceManager.getInstance().switchToClassResourceStack();
ResourceManager.getInstance().deleteResources();
KubeUtils.clearOdhCRDs();
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/io/odh/test/e2e/standard/StandardAbstract.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@

import io.odh.test.Environment;
import io.odh.test.e2e.Abstract;
import io.odh.test.framework.OdhResourceCleaner;
import io.odh.test.framework.manager.ResourceManager;
import io.odh.test.install.BundleInstall;
import io.odh.test.install.InstallTypes;
import io.odh.test.install.OlmInstall;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

import static org.junit.jupiter.api.Assertions.fail;

@ExtendWith(OdhResourceCleaner.class)
public class StandardAbstract extends Abstract {

private static final Logger LOGGER = LoggerFactory.getLogger(Abstract.class);
Expand Down

0 comments on commit 0b65b8e

Please sign in to comment.