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

Fix up nightly corpus tests #22

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

patjakdev
Copy link
Collaborator

Issue #, if available: None

Description of changes:

This PR causes the Github action to fail correctly when the corpus tests have failed such that our alerting will actually be invoked.

I've also pulled in the fixes from #16 so that the tests now pass.

I'd like to make additional changes to get these to run on every PR and to check in a copy of the tests to this repo and change the alerting to let us know when the tests are out of sync with the upstream version, but I'll save those for later. This at least gets us back to status quo.

This sets the `-o pipefail` behavior that you might expect to be a default (see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference). Without this setting, `go test -count=1 -v -tags corpus ./integration_tests/... | tail` will always return a success error code.

Signed-off-by: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
…d run.

Right now, the only other way to run the tests is to invoke them manually. If I'm running them against some experiment in my branch, I don't want to alert anybody about the failure.

Signed-off-by: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
…led in some fatal way.

Commit [b6e8040](cedar-policy/cedar-integration-tests@b6e8040) reduced the size of the tgz file by 25%, which was the likely culprit in reducing the size of the test suite.

Signed-off-by: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
Signed-off-by: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
Comment on lines +10 to +12
defaults:
run:
shell: bash
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Setting bash here invokes the default -o pipefail behavior that correctly makes it so that the go test -count=1 -v -tags corpus ./integration_tests/... | tail fails when the tests fail.

@@ -26,7 +30,7 @@ jobs:
run: go test -count=1 -v -tags corpus ./integration_tests/... | tail

- name: Notify on Failure
if: failure()
if: failure() && github.event_name == 'schedule'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We only want to be notified when this fails in the nightly run. Manual invocations shouldn't file an issue.

Copy link
Collaborator

@philhassey philhassey left a comment

Choose a reason for hiding this comment

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

Short of a manual test of this here, it looks good.

@patjakdev
Copy link
Collaborator Author

Short of a manual test of this here, it looks good.

You can see a successful run of the tests over in the StrongDM fork.

@patjakdev patjakdev merged commit 80549a3 into cedar-policy:main Jul 3, 2024
3 checks passed
@patjakdev patjakdev deleted the idx-65/fix-corpus-alerts branch July 5, 2024 15:53
@patjakdev patjakdev restored the idx-65/fix-corpus-alerts branch July 5, 2024 15:53
@patjakdev patjakdev deleted the idx-65/fix-corpus-alerts branch July 5, 2024 15:54
@patjakdev patjakdev mentioned this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants