-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add continuous test for check odh project stats + refactor tests (#16)
- Loading branch information
Showing
4 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/test/java/io/odh/test/e2e/continuous/DataScienceProjectIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Tealc authors. | ||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
*/ | ||
package io.odh.test.e2e.continuous; | ||
|
||
import io.fabric8.kubernetes.api.model.KubernetesResourceList; | ||
import io.fabric8.kubernetes.client.dsl.MixedOperation; | ||
import io.fabric8.kubernetes.client.dsl.Resource; | ||
import io.odh.test.e2e.Abstract; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
import org.kubeflow.v1.Notebook; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
@Tag("continuous") | ||
public class DataScienceProjectIT extends Abstract { | ||
|
||
private final String DS_PROJECT_NAME = "test"; | ||
private final String DS_WORKBENCH_NAME = "test-workbench"; | ||
MixedOperation<Notebook, KubernetesResourceList<Notebook>, Resource<Notebook>> notebookCli; | ||
|
||
@BeforeAll | ||
void init() { | ||
notebookCli = kubeClient.notebookClient(); | ||
} | ||
|
||
@Test | ||
void checkDataScienceProject() { | ||
assertTrue(kubeClient.namespaceExists(DS_PROJECT_NAME)); | ||
|
||
assertEquals("true", | ||
kubeClient.getNamespace(DS_PROJECT_NAME).getMetadata().getLabels().getOrDefault("opendatahub.io/dashboard", "false")); | ||
|
||
Notebook testWorkbench = notebookCli.inNamespace(DS_PROJECT_NAME).withName(DS_WORKBENCH_NAME).get(); | ||
|
||
assertEquals("true", | ||
testWorkbench.getMetadata().getLabels().getOrDefault("opendatahub.io/dashboard", "false")); | ||
assertEquals("true", | ||
testWorkbench.getMetadata().getLabels().getOrDefault("opendatahub.io/odh-managed", "false")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters