-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: pre-factor code related to junit reporting (#580)
* report ordering * e2e test suite * reporting abstraction Signed-off-by: Marcin Owsiany <[email protected]>
- Loading branch information
Showing
35 changed files
with
573 additions
and
24 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,22 @@ | ||
name: "End-to-end tests" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- releases/* | ||
pull_request: | ||
branches: | ||
- main | ||
- releases/* | ||
|
||
jobs: | ||
e2e-tests: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.21 | ||
- uses: actions/[email protected] | ||
- name: "Run end-to-end tests" | ||
run: make e2e-test |
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
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,6 @@ | ||
/kuttl-ouput-step-json.txt | ||
/kuttl-ouput-step-xml.txt | ||
/kuttl-report-step.json | ||
/kuttl-report-step.json.normalized | ||
/kuttl-report-step.xml | ||
/kuttl-report-step.xml.normalized |
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,24 @@ | ||
.PHONY: test | ||
test: | ||
$(MAKE) -C ../../ cli | ||
rm -f kuttl-report-step.xml.normalized kuttl-report-step.json.normalized | ||
../../bin/kubectl-kuttl test --config /dev/null --start-control-plane --report-name kuttl-report-step --timeout 10 --report xml suite1 suite2 > kuttl-ouput-step-xml.txt 2>&1 || true # this is meant to fail | ||
if [ ! -e kuttl-report-step.xml ]; then cat kuttl-output-step-xml.txt; exit 1; fi | ||
../../bin/kubectl-kuttl test --config /dev/null --start-control-plane --report-name kuttl-report-step --timeout 10 --report json suite1 suite2 > kuttl-ouput-step-json.txt 2>&1 || true # this is meant to fail | ||
if [ ! -e kuttl-report-step.json ]; then cat kuttl-output-step-json.txt; exit 1; fi | ||
$(MAKE) kuttl-report-step.xml.normalized kuttl-report-step.json.normalized | ||
diff -u kuttl-report-step.xml.golden kuttl-report-step.xml.normalized | ||
diff -u kuttl-report-step.json.golden kuttl-report-step.json.normalized | ||
|
||
.PHONY: update-golden | ||
update-golden: | ||
cp kuttl-report-step.json.normalized kuttl-report-step.json.golden | ||
cp kuttl-report-step.xml.normalized kuttl-report-step.xml.golden | ||
|
||
# The following targets replace all timestamps and durations with dummy values to make comparisons easy. | ||
|
||
%.xml.normalized: %.xml | ||
sed -E -e 's/time="[^"]+"/time="1.0"/g; s/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{6,10}(Z|[-+][0-9]{2}:[0-9]{2})/2000-01-01T00:00:00.00000000+00:00/g' < $< > $@ | ||
|
||
%.json.normalized: %.json | ||
sed -E -e 's/"time": *"[^"]+"/"time": "1.0"/g; s/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{6,10}(Z|[-+][0-9]{2}:[0-9]{2})/2000-01-01T00:00:00.00000000+00:00/g' < $< > $@ |
Oops, something went wrong.