-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcin Owsiany <[email protected]>
- Loading branch information
Showing
30 changed files
with
474 additions
and
1 deletion.
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
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' < $< > $@ |
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,204 @@ | ||
{ | ||
"name": "", | ||
"tests": 18, | ||
"failures": 4, | ||
"time": "1.0", | ||
"testsuite": [ | ||
{ | ||
"tests": 9, | ||
"failures": 2, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "suite1", | ||
"testsuite": [ | ||
{ | ||
"tests": 2, | ||
"failures": 0, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "test0", | ||
"testcase": [ | ||
{ | ||
"classname": "test0", | ||
"name": "setup", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test0", | ||
"name": "step 0-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 4, | ||
"failures": 1, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "test1", | ||
"testcase": [ | ||
{ | ||
"classname": "test1", | ||
"name": "setup", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test1", | ||
"name": "step 0-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test1", | ||
"name": "step 1-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test1", | ||
"name": "step 2-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"failure": { | ||
"text": "command \"echo step stdout\\\\n echo \u003e\u00262 step stderr\\\\n false\" failed, exit status 1", | ||
"message": "failed in step 2-run" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 3, | ||
"failures": 1, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "test2", | ||
"testcase": [ | ||
{ | ||
"classname": "test2", | ||
"name": "setup", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test2", | ||
"name": "step 0-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test2", | ||
"name": "step 1-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"failure": { | ||
"text": "command \"echo assert stdout\\\\n echo \u003e\u00262 assert stderr\\\\n false\" failed, exit status 1", | ||
"message": "failed in step 1-run" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 9, | ||
"failures": 2, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "suite2", | ||
"testsuite": [ | ||
{ | ||
"tests": 2, | ||
"failures": 0, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "test0", | ||
"testcase": [ | ||
{ | ||
"classname": "test0", | ||
"name": "setup", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test0", | ||
"name": "step 0-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 4, | ||
"failures": 1, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "test1", | ||
"testcase": [ | ||
{ | ||
"classname": "test1", | ||
"name": "setup", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test1", | ||
"name": "step 0-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test1", | ||
"name": "step 1-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test1", | ||
"name": "step 2-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"failure": { | ||
"text": "command \"echo step stdout\\\\n echo \u003e\u00262 step stderr\\\\n false\" failed, exit status 1", | ||
"message": "failed in step 2-run" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 3, | ||
"failures": 1, | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"name": "test2", | ||
"testcase": [ | ||
{ | ||
"classname": "test2", | ||
"name": "setup", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test2", | ||
"name": "step 0-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0" | ||
}, | ||
{ | ||
"classname": "test2", | ||
"name": "step 1-run", | ||
"timestamp": "2000-01-01T00:00:00.00000000+00:00", | ||
"time": "1.0", | ||
"failure": { | ||
"text": "command \"echo assert stdout\\\\n echo \u003e\u00262 assert stderr\\\\n false\" failed, exit status 1", | ||
"message": "failed in step 1-run" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
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,44 @@ | ||
<testsuites name="" tests="18" failures="4" time="1.0"> | ||
<testsuite tests="9" failures="2" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="suite1"> | ||
<testsuite tests="2" failures="0" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="test0"> | ||
<testcase classname="test0" name="setup" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test0" name="step 0-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
</testsuite> | ||
<testsuite tests="4" failures="1" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="test1"> | ||
<testcase classname="test1" name="setup" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test1" name="step 0-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test1" name="step 1-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test1" name="step 2-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"> | ||
<failure message="failed in step 2-run" type="">command "echo step stdout\\n echo >&2 step stderr\\n false" failed, exit status 1</failure> | ||
</testcase> | ||
</testsuite> | ||
<testsuite tests="3" failures="1" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="test2"> | ||
<testcase classname="test2" name="setup" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test2" name="step 0-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test2" name="step 1-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"> | ||
<failure message="failed in step 1-run" type="">command "echo assert stdout\\n echo >&2 assert stderr\\n false" failed, exit status 1</failure> | ||
</testcase> | ||
</testsuite> | ||
</testsuite> | ||
<testsuite tests="9" failures="2" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="suite2"> | ||
<testsuite tests="2" failures="0" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="test0"> | ||
<testcase classname="test0" name="setup" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test0" name="step 0-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
</testsuite> | ||
<testsuite tests="4" failures="1" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="test1"> | ||
<testcase classname="test1" name="setup" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test1" name="step 0-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test1" name="step 1-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test1" name="step 2-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"> | ||
<failure message="failed in step 2-run" type="">command "echo step stdout\\n echo >&2 step stderr\\n false" failed, exit status 1</failure> | ||
</testcase> | ||
</testsuite> | ||
<testsuite tests="3" failures="1" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" name="test2"> | ||
<testcase classname="test2" name="setup" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test2" name="step 0-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"></testcase> | ||
<testcase classname="test2" name="step 1-run" timestamp="2000-01-01T00:00:00.00000000+00:00" time="1.0" assertions="0"> | ||
<failure message="failed in step 1-run" type="">command "echo assert stdout\\n echo >&2 assert stderr\\n false" failed, exit status 1</failure> | ||
</testcase> | ||
</testsuite> | ||
</testsuite> | ||
</testsuites> |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
echo assert stdout | ||
echo >&2 assert stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
echo step stdout | ||
echo >&2 step stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
echo assert stdout | ||
echo >&2 assert stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
echo step stdout | ||
echo >&2 step stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
echo assert stdout | ||
echo >&2 assert stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
echo step stdout | ||
echo >&2 step stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
echo step stdout | ||
echo >&2 step stderr | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
echo assert stdout | ||
echo >&2 assert stderr | ||
true |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
echo step stdout | ||
echo >&2 step stderr | ||
true |
Oops, something went wrong.