-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix running integration tests as part of build #12693
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
Conversation
/werft run 👍 started the job as gitpod-build-mads-fix-with-integration-tests.16 |
fd9729f
to
f2a2753
Compare
started the job as gitpod-build-mads-fix-with-integration-tests.32 because the annotations in the pull request description changed |
21230d3
to
c14dfdc
Compare
c14dfdc
to
6acb87a
Compare
4e05203
to
3044bdd
Compare
started the job as gitpod-build-mads-fix-with-integration-tests.39 because the annotations in the pull request description changed |
started the job as gitpod-build-mads-fix-with-integration-tests.40 because the annotations in the pull request description changed |
ccc51b2
to
f84e4bd
Compare
@utam0k I'd like you to review this as you've been working on integration tests for workspace recently. Does the README capture how you have been working on integration tests? Are there any instructions or tips & tricks missing? |
@mads-hartmann Thanks for your great PR. |
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.
Thank you @mads-hartmann , tested and works! 🚀
Yeah that's right, currently it won't send Slack notifications. After this PR is merged I'll look into seeing how we can have the IDE and Workspace integration tests jobs use this script. There are two approaches (at least)
Either way, we'd have to figure out exactly how to trigger the Slack notifications. But let's take that after this PR is merged 🧡 |
Co-authored-by: Gero Posmyk-Leinemann <[email protected]>
0df8deb
to
77a6c85
Compare
Rebase on main to remove conflict (an image version was bumped in run-integration-tests which this PR removes entirely) |
switch (value) { | ||
case null: | ||
case undefined: | ||
return "skip"; |
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.
Why do we default to skip
here, but for empty-string/unknown we default to all
?
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.
It's mainly about how we want to interpret how people use (or not use) the with-integration-tests
job attribute, especially when used in GH comments/PR descriptions where you can use /werft run with-integration-tests
or if you just set the attribute in your PR description (/werft with-integration-tests
- in both cases without specifying a value - which case the value is the empty string.
In the CLI it's less common but you could do werft job run github -a with-integration-tests=""
.
So if it is null/undefined it means they didn't use the with-integration-tests
attribute at all - if it's the empty string they did use it, but just didn't specify a value - I decided to interpret that as "they want to run all the tests"
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.
Would it be useful to add this explanation as a comment in the code, or do you think it is overkill?
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 added a log line of
werft.log(sliceID, "with-integration-tests was not set - will use 'skip'");
As I think that will
- Capture the essence of the description above. Each of the three cases (not set, set to empty, set to unknown value) now have a log line that describe things a bit
- This might be useful as it will help people know if they made a typo in the attribute, e.g. "with-integration-test" (missing
s
)
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.
🚀
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.
Thanks! LGTM
For the IDE we currently have two completely separate sets (vscode, jetbrains) of integration tests that are not really connected to each other, it would be nice if they could be separated, but that can be something for later, thank you very much for your work! 🎉 |
Description
This PR makes it possible to use
with-integration-tests
to run integration tests as part of the build job. This functionality has existed for a long time, but it was never updated to work with Harvester-based preview environments.The old approach was to start a separate Werft job which used the
eu.gcr.io/gitpod-core-dev/build/integration-tests:{{ .Annotations.version }}
image in Werft. This meant it would run the compiled integration tests. However, this image doesn't have any of the utility scripts available we need to configure access to the the preview environment.So I instead decided to delete the
.werft/run-integration-tests.yaml
job and instead introduce a small helper script -test/run.sh
- which usesgo
to run the tests. This is similar to the approach adopted by Workspace (.werft/workspace-run-integration-tests.sh) and IDE (.werft/ide-integration-tests-startup.yaml).My intention is to use
test/run.sh
in both the Workspace and IDE integration test jobs too, so that we have a single way to run integration tests which is used in both Werft and Gitpod workspaces - but I'll look into this in a follow up PR.This PR also adds a new checkbox for
with-integration-tests
to the PR template so spread awareness of the flag.Related Issue(s)
Part of #12350
How to test
I ran the script manually from my Gitpod workspace
I ran it through Werft (see job)
Release Notes
Documentation
N/A
Werft options:
Valid updates are
all
,workspace
,webapp
,ide