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

[Integration tests]: manually get the current commit for the action when bootstrapping the project. #405

Merged
merged 10 commits into from
Sep 18, 2024

Conversation

IfSentient
Copy link
Collaborator

@IfSentient IfSentient commented Sep 13, 2024

This PR does two things:

  • Moves testing to a reusable workflow which is now shared between the main, pr, and release workflows.
  • Updates the integration tests to use the version of the grafana-app-sdk that matches the code the action is being run against (using a replace directive in the go.mod, as using GITHUB_SHA doesn't cooperate with go get in PR builds).

Currently, the branch protection settings for main require that an action named test complete successfully to merge (which no longer exists the same way, so this blocks indefinitely), once this PR is approved I will update the branch protection settings to require test / unit-test, test / integration-test, and test / build instead, then merge this PR so other PR's will need to merge in from main to get correct testing.

@IfSentient IfSentient requested a review from a team as a code owner September 13, 2024 14:21
Copy link
Contributor

@radiohead radiohead left a comment

Choose a reason for hiding this comment

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

@IfSentient Looks like using git to get commit rev won't work, but we could get that info from the env vars – https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables.

IIUC GITHUB_SHA should fit the bill.

@IfSentient
Copy link
Collaborator Author

@IfSentient Looks like using git to get commit rev won't work, but we could get that info from the env vars – https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables.

IIUC GITHUB_SHA should fit the bill.

I tried that before, and I get the error

go: github.com/grafana/grafana-app-sdk@9bb57268ee194cd7cfa69a892ec20d1293134cef: invalid version: unknown revision 9bb57268ee194cd7cfa69a892ec20d1293134cef

It looks like 9bb57268ee194cd7cfa69a892ec20d1293134cef exists, but is some kind of fake commit that is the totality of the PR instead of being a commit in the branch or in main, which I suspect is why go get is having problems.

@IfSentient IfSentient merged commit 73db82e into main Sep 18, 2024
9 checks passed
@IfSentient IfSentient deleted the integration-tests-use-current-commit branch September 18, 2024 21:02
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