Skip to content
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

Update tests wrt ginkgo 2: Add Serial decorators and change checks for serial run #8770

Merged

Conversation

dhiller
Copy link
Contributor

@dhiller dhiller commented Nov 11, 2022

What this PR does / why we need it:

Ginkgo V2 has the decorator Serial that is designed for running tests in serial. Further the docs for parallel test support say that test results will all be captured in one output stream in Ginkgo 2.

As a preparation to use the new features this PR:

  • adds the Serial decorator,
  • updates the checks for serial run and
  • updates documentation so that people don't forget when they add or update tests.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

See #8776

Release note:

Add Ginkgo V2 Serial decorator to serial tests as preparation to simplify parallel vs. serial test run logic

@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Nov 11, 2022
@dhiller dhiller changed the title Update parallel test logic wrt ginkgo 2 Simplify running parallel and serial tests wrt ginkgo 2 Nov 11, 2022
@dhiller
Copy link
Contributor Author

dhiller commented Nov 11, 2022

/test pull-kubevirt-e2e-k8s-1.24-sig-compute
/test pull-kubevirt-e2e-k8s-1.24-sig-compute-migrations
/test pull-kubevirt-e2e-k8s-1.24-sig-network
/test pull-kubevirt-e2e-k8s-1.24-sig-storage
/test pull-kubevirt-e2e-kind-1.22-sriov

Copy link
Contributor

@oshoval oshoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Few notes:
It makes KUBEVIRT_E2E_RUN_ALL_SUITES obsolete and always true
as it will run the serial even that the parallel is failed (didnt validate but i believe this is the behavior)
(the periodic lanes are the ones that use it from what i remember)

Once junit merger is removed, additional changes should be done for the unit tests
as they run parallel and use junit merger (saw that junit merger removal is planned for other PR).
(once it is dropped, we can drop staging/src/kubevirt.io/client-go/reporter/reporter.go and use the new built in junit-reporter instead junit-output IIRC)

Should we also remove the [Serial] manual label ?
It is not needed, but might left for helping readability ? (note that it is redundant and might be nicer to remove it)
Unless it allows to run manually only the serial ones, with focus style?
(or vice versa to skip just the serial ones when running locally)
Better that we will have options for those

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 13, 2022
fi

functest ${test_args} ${KUBEVIRT_FUNC_TEST_GINKGO_ARGS}
Copy link
Contributor

@oshoval oshoval Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to use --junit-report ( --output-dir might be needed as well) ?
and then to remove the call to the custom reporter at tests/tests_suite_test.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oshoval thanks for your review and the reminders.

Regarding the flag: IIRC no, we don't need to use the flag here, since it has a default value. But we can't drop it for backwards compatibility of other builds (like i.e. our d/s build), who are using this one to override the test output file name.

Regarding the custom reporter, thanks for the hint, will look into it.

@dhiller dhiller force-pushed the update-parallel-test-logic-wrt-ginkgo-2 branch 2 times, most recently from 9e5bc01 to eb2331e Compare November 14, 2022 11:07
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 14, 2022
@dhiller
Copy link
Contributor Author

dhiller commented Nov 14, 2022

/test pull-kubevirt-e2e-k8s-1.24-sig-compute
/test pull-kubevirt-e2e-k8s-1.24-sig-compute-migrations

@dhiller
Copy link
Contributor Author

dhiller commented Nov 15, 2022

/test pull-kubevirt-e2e-k8s-1.24-sig-compute
/test pull-kubevirt-e2e-k8s-1.24-sig-compute-migrations
/test pull-kubevirt-e2e-k8s-1.24-sig-network
/test pull-kubevirt-e2e-k8s-1.24-sig-storage
/test pull-kubevirt-e2e-kind-1.22-sriov

Tests that check for running in serial need to get adapted to
use info from the current spec, since there's no more separate
running, thus the ParallelTotal will stay the same, even if the
test is run in Serial mode.

Signed-off-by: Daniel Hiller <[email protected]>
@dhiller dhiller force-pushed the update-parallel-test-logic-wrt-ginkgo-2 branch from 74becdc to 9eb3d11 Compare November 15, 2022 12:30
@dhiller
Copy link
Contributor Author

dhiller commented Nov 15, 2022

/test pull-kubevirt-e2e-k8s-1.24-sig-compute
/test pull-kubevirt-e2e-k8s-1.24-sig-compute-migrations

@dhiller dhiller changed the title Simplify running parallel and serial tests wrt ginkgo 2 Add Serial decorators and change checks for serial run - tests wrt ginkgo 2 Nov 15, 2022
@dhiller dhiller changed the title Add Serial decorators and change checks for serial run - tests wrt ginkgo 2 Update tests wrt ginkgo 2: Add Serial decorators and change checks for serial run Nov 15, 2022
@dhiller dhiller marked this pull request as ready for review November 16, 2022 09:12
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2022
@kubevirt-bot kubevirt-bot requested a review from EdDev November 16, 2022 09:12
@dhiller dhiller requested review from xpivarc and enp0s3 and removed request for phoracek, rthallisey and EdDev November 16, 2022 10:21
Copy link
Contributor

@enp0s3 enp0s3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhiller Thank you for the clarity !
/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enp0s3

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2022
@oshoval
Copy link
Contributor

oshoval commented Nov 17, 2022

I am a bit lost about his PR and #8788
can you please elaborate which commits there are unique and what is common ?

You consider this PR as a working standalone ?
are we safe despite we still also call the old reporter as well ?
maybe better to remove it in this PR ? just the calls to the old reporter from the e2e tests

@enp0s3
Copy link
Contributor

enp0s3 commented Nov 17, 2022

@oshoval From what I understand, this PR only prepares the ground for using Ginkgo parallel testing by just decorating with Serial the tests that should run in serial. Current PR won't replace our mechanism of Parallel and Serial testing.

@oshoval
Copy link
Contributor

oshoval commented Nov 17, 2022

@oshoval From what I understand, this PR only prepares the ground for using Ginkgo parallel testing by just decorating with Serial the tests that should run in serial. Current PR won't replace our mechanism of Parallel and Serial testing.

ah right, commits that were here where moved

@enp0s3
Copy link
Contributor

enp0s3 commented Nov 17, 2022

@oshoval The separation also announced in #8776

Copy link
Contributor

@oshoval oshoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

PR desc
"updates the checks for serial run and"
the word and is not needed

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2022
@kubevirt-bot kubevirt-bot merged commit 55d7144 into kubevirt:main Nov 18, 2022
iholder101 added a commit to iholder101/kubevirt that referenced this pull request Jan 3, 2023
This is a backport of the changes introduced here:
kubevirt#8770.

Signed-off-by: Itamar Holder <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants