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

chore: add plugin provisioning script for E2E tests #28

Closed
wants to merge 2 commits into from

Conversation

vickyyyyyyy
Copy link
Member

In order to run our E2E tests, we require the provisioning yaml file to be in the <rootDir>/provisioning folder: https://github.com/grafana/grafana/blob/1d689888b0fc2de2dbed6e606eee19561a3ef006/packages/grafana-e2e/cypress/plugins/readProvisions.js#L12

This is already set up for the build but if we want to debug the tests locally, we would also need this set up.

Adding this script so it can be automated and copied over in our plugins (or if there is some way to export this and use this actual script?) so in the package.json file, we can do something like:

{
   "provision-plugin": "bash provision-plugin.sh datadog"
   "e2e:dev": "yarn provision-plugin && grafana-e2e run"
}

This script expects the provisioning file name to be passed in so we only grab the one yaml file needed instead of the whole repository.

First time set up

File name not passed in

Screenshot 2021-01-26 at 12 35 36

Invalid file name

Screenshot 2021-01-26 at 12 35 55

Valid file name

Screenshot 2021-01-26 at 12 38 53

Non-first time set up

File name not passed in

Screenshot 2021-01-26 at 12 37 28

Invalid file name

Screenshot 2021-01-26 at 12 37 43

Valid file name

Screenshot 2021-01-26 at 12 37 56

@vickyyyyyyy vickyyyyyyy requested a review from a team January 26, 2021 12:40
@vickyyyyyyy vickyyyyyyy self-assigned this Jan 26, 2021
Copy link
Contributor

@scottlepp scottlepp left a comment

Choose a reason for hiding this comment

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

You could use node instead of bash: then from scripts: "node run ./provision.js"

But...I just do this (assumes you have the provisioning repo cloned in your workspace): https://github.com/grafana/jira-datasource/blob/master/DEV-GUIDE.md

@vickyyyyyyy
Copy link
Member Author

You could use node instead of bash: then from scripts: "node run ./provision.js"

But...I just do this (assumes you have the provisioning repo cloned in your workspace): https://github.com/grafana/jira-datasource/blob/master/DEV-GUIDE.md

Yeah, I was thinking about symlinking instead but thought it would be nice to have something automated instead so you don't need to set it up for each plugin. Especially since I sometimes have multiple copies of the same repo/plugin for testing different things 😬

@vickyyyyyyy
Copy link
Member Author

Closing - not needed for now

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.

None yet

2 participants