Workspace integration tests: Poll for job phase instead of tailing logs #12069
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The workspace integration tests have been failing consistently since we switched to gRPC with an error related to communicating with Werft (see issue).
I narrowed the error down to when we use
werft job logs
and was able to get that to fail consistently in Werft by triggering the integration test jobs. However, I wasn't able to getwerft job logs
to fail when using the command from a Gitpod workspace.So instead of trying to modify any timeouts in our system I opted to instead change how the integration test job waits for the completion of the build job for the preview environment. We now poll for that phase until the job completes and then check if the job was successful. The downside of this approach is that you no longer get the logs of the build job in your integration tests jobs but I think that's a reasonable trade-off.
I decided to move your bash script into a separate file as I found it hard to edit the bash inside of YAML. If you're unhappy with this change let me know and I can move it back. Because of that change this PR is easiest to read commit-by-commit☺️
I also cleaned up some of the output of the script a bit so that the logs goes into the relevant slices (see the difference between gitpod-custom-mads-ws-integration-tests.1 and gitpod-custom-mads-ws-integration-tests.2
Related Issue(s)
Fixes #11979
How to test
During development I ran this job using:
See the most recent job here. The integration tests don't pass but I think that's outside the scope of this PR - at least it's able to run the tests again with this change☺️
Release Notes
Documentation
N/A
Werft options: