-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate E2E and operator tests (#1540)
This runs operator tests as a separate test in parallel with the other tests. It makes operator tests independent from E2E test results and their failures distinguishable. Signed-off-by: Jan Schlicht <jan@d2iq.com> Signed-off-by: Ken Sipe <kensipe@gmail.com> Co-authored-by: Ken Sipe <kensipe@gmail.com>
- Loading branch information
Showing
6 changed files
with
61 additions
and
20 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
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,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
set -o xtrace | ||
|
||
# Operator tests have the same setup but different concerns from E2E tests. | ||
# The motivation is to get earlier feedback when these tests fail. In the past, the operator tests were only run if the E2E tests succeeded. | ||
# This made it hard for larger PRs to distinguish between changes that fix operators and changes that fix E2E tests. | ||
|
||
INTEGRATION_OUTPUT_JUNIT=${INTEGRATION_OUTPUT_JUNIT:-false} | ||
# Exposing `KUDO_VERSION` allows for KUDO_VERSION to be overriden. The default value of test is used as a tag for the Docker image that is build and injected to the kind cluster. | ||
# This is to avoid clashes with existing Docker images as test is only used in this context. | ||
KUDO_VERSION=${KUDO_VERSION:-test} | ||
|
||
docker build . \ | ||
--build-arg ldflags_arg="" \ | ||
-t "kudobuilder/controller:$KUDO_VERSION" | ||
|
||
rm -rf operators | ||
git clone https://github.com/kudobuilder/operators | ||
mkdir operators/bin/ | ||
cp ./bin/kubectl-kudo operators/bin/ | ||
sed "s/%version%/$KUDO_VERSION/" operators/kudo-test.yaml.tmpl > operators/kudo-test.yaml | ||
|
||
if [ "$INTEGRATION_OUTPUT_JUNIT" == true ] | ||
then | ||
echo "Running operator tests with junit output" | ||
mkdir -p reports/ | ||
go get github.com/jstemmer/go-junit-report | ||
|
||
cd operators && ./bin/kubectl-kudo test --artifacts-dir /tmp/kudo-e2e-test 2>&1 \ | ||
| tee /dev/fd/2 \ | ||
| go-junit-report -set-exit-code \ | ||
> ../reports/kudo_operators_test_report.xml | ||
else | ||
echo "Running operator tests without junit output" | ||
|
||
cd operators && ./bin/kubectl-kudo test --artifacts-dir /tmp/kudo-e2e-test | ||
fi |
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