forked from kubeflow/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backend] Refactor integration tests, facilitate local testing (kubef…
…low#3138) * Make local testing easier * Move cleanup to test setup stage * Add readme for how to run integration tests * Add warning about data loss * Add warning also in the script * Change flag to isDevMode and cleanup resources if not in dev mode * Pass through arguments in the bash script * Fix unit tests
- Loading branch information
Showing
8 changed files
with
137 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Api Server Integration Tests | ||
|
||
### WARNING | ||
**These integration tests will delete all the data in your KFP instance, please only use a test cluster to run these.** | ||
|
||
### How to run | ||
|
||
1. Configure kubectl to connect to your kfp cluster. | ||
2. Run the following for all integration tests: `NAMESPACE=<kfp-namespace> ./run_tests_locally.sh`. | ||
3. Or run the following to select certain tests: `NAMESPACE=<kfp-namespace> ./run_tests_locally.sh -testify.m Job`. | ||
Reference: https://stackoverflow.com/a/43312451 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -z "${NAMESPACE}" ]; then | ||
echo "NAMESPACE env var is not provided, please set it to your KFP namespace" | ||
exit | ||
fi | ||
|
||
echo "The api integration tests run against the cluster your kubectl communicates to."; | ||
echo "It's currently '$(kubectl config current-context)'." | ||
echo "WARNING: this will clear up all existing KFP data in this cluster." | ||
read -r -p "Are you sure? [y/N] " response | ||
case "$response" in | ||
[yY][eE][sS]|[yY]) | ||
;; | ||
*) | ||
exit | ||
;; | ||
esac | ||
|
||
echo "Starting integration tests..." | ||
command="go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true -isDevMode=true" | ||
echo $command "$@" | ||
$command "$@" |
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