-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e: Run tests as sub-tests #242
Conversation
Codecov Report
@@ Coverage Diff @@
## master #242 +/- ##
=======================================
Coverage 30.25% 30.25%
=======================================
Files 5 5
Lines 476 476
=======================================
Hits 144 144
Misses 315 315
Partials 17 17
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
cd64c5b
to
6bb856f
Compare
/retest |
1 similar comment
/retest |
// We're unable to use parallel tests because of our usage of testify/suite. | ||
// See https://github.com/stretchr/testify/issues/187 | ||
// | ||
// nolint:paralleltest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah… 🙁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we would want parallel tests anyway, since these are integration tests making changes to a live system, if they were run in parallel they might interfere with each other.
Running into the same error |
9ccfeb8
to
e593b14
Compare
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @JAORMX! This will make it easier for contributors to understand the source of errors. 👍
The issue about being unable to run parallel tests we can resolve on another PR. Holding for any extra thoughts from @saschagrunert
/lgtm
/hold
Assuming the issue on the E2E tests was resolved by #252 /test pull-security-profiles-operator-test-e2e |
Looks like the test failure is not transient: |
57f1af7
to
d5cdb72
Compare
I removed the per-section "Run" statements, and limited this PR to only the actual sub-tests. Let's see if this works better in CI. |
/retest |
Currently, the tests e2e are being from a single `TestSuite` which iterates through the test definitions calling their respective functions. However, if one of these definitions were to fail, the error is reported towards the upper `TestSuite` test. This uses testify's `Suite` object ability to run sub-tests (similar to what `testing.T` provides) and instead uses that. This way, any errors coming from a sub-test will be reported for that sub-test and it'll be easier to debug. One thing to note is that given our usage of testify's `Suite`, we aren't able to do parallel testing in our e2e tests. In order to enable this, we'd need to move away from the `Suite` object or use a different framework. Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
/test pull-security-profiles-operator-test-e2e |
We don't support parallelization there yet anyway. Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
It was not working in the namespace tests. Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JAORMX, pjbgf, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Currently, the tests e2e are being from a single
TestSuite
whichiterates through the test definitions calling their respective
functions.
However, if one of these definitions were to fail, the error is reported
towards the upper
TestSuite
test.This uses testify's
Suite
object ability to run sub-tests (similar towhat
testing.T
provides) and instead uses that.This way, any errors coming from a sub-test will be reported for that
sub-test and it'll be easier to debug.
Does this PR have test?
N/A
Special notes for your reviewer:
One thing to note is that given our usage of testify's
Suite
, wearen't able to do parallel testing in our e2e tests. In order to enable
this, we'd need to move away from the
Suite
object or use a differentframework.
See stretchr/testify#187
Does this PR introduce a user-facing change?