-
Notifications
You must be signed in to change notification settings - Fork 29
ci: create new shared action to run e2e tests against pre-selected stack #1340
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
base: main
Are you sure you want to change the base?
Conversation
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.
@yduartep 👋
Haven't properly reviewed the PR but I wonder if this is an action that could fit better in https://github.com/grafana/plugin-ci-workflows?
Good point. I can move it there if you think is a better choice. Take a look and let me know. I have not a problem to move it. |
@tolzhabayev wdyt? Worth moving to that repository? |
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.
wow this is cool @yduartep !
@tolzhabayev 👋 just a small reminder in case you've missed it! |
Answered here. Waiting for suggestion about the right place from giuseppe. |
return obj; | ||
} | ||
|
||
function getBaseUrlByEnv(env) { |
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.
For shared workflow (for security reasons), I think we should limit it to dev/ops only and make the function more universal (add templating to URLs to inject regions)
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.
Hi @kozhuhds I am agree with you about removing prod from here.
Regarding the region, exactly what you mean? Get the base url with something like https://hg-api-${answers.ENV}-0.grafana${dev ? '-dev' : ops? '-ops': ''}.net
?
I was trying to fetch the list of possible regions dynamically but I couldn't found the way. I tried to call the /{stackSlug}/instances
api receiving by parameter also env=dev|ops
and get directly the regionSlug to use on the baseUrl but I think I will need another token and I don't want to add more input params.
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.
api-${answers.ENV}-0.grafana${dev ? '-dev' : ops? '-ops': ''}.net
yes smth like this (moreover, you can identify if it's ops or dev from env
)
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.
Hi @kozhuhds I pushed some changes. Can you take a look again?
uses: grafana/shared-workflows/actions/get-vault-secrets@5d7e361bc7e0a183cde8afe9899fb7b596d2659b # v1.2.0 | ||
with: | ||
common_secrets: | | ||
HG_TOKEN=hg-ci:token |
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.
which HG_TOKEN is added to Vault?
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.
a token I generated in the past using the same steps you described in asserts and is working. You can see a successful execution here.
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.
my doubt here is that this is a shared workflow that depends on a personal token; technically, I don't really see a problem here, but I just wonder if we can end up with smth more general (not a blocker)
create new shared action to run e2e tests against pre-selected stack. You define in which region the selected stack belong, the plugin from where are executed the tests and optionally which other plugins and datasources you want to provision in that stack when starting a Grafana instance. You need to have the playwright configuration and the test specifications in the plugin that run the tests.