feat(plugin-e2e): fetch e2e-selectors from Grafana at runtime - #2819
Draft
sunker wants to merge 1 commit into
Draft
feat(plugin-e2e): fetch e2e-selectors from Grafana at runtime#2819sunker wants to merge 1 commit into
sunker wants to merge 1 commit into
Conversation
The selectors fixture fetches the data-only /public/e2e-selectors.json from the Grafana under test, reconstructs the template descriptors into functions locally (no eval) and resolves them. When the instance does not serve the file it falls back to the bundled @grafana/e2e-selectors (quiet on 404, warns on other failures).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Adds a runtime path to the
selectorsfixture: it fetches the data-only/public/e2e-selectors.jsonfrom the Grafana under test and reconstructs the template descriptors into selectors locally (no eval), falling back to the bundled@grafana/e2e-selectorswhen the file isn't served. No opt-in flag - it's used automatically when present, so tests stay in sync with the Grafana under test without the nightly npm dist-tag.Pairs with the grafana/grafana side that serves the file.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Reconstruction only substitutes {0}/{1} placeholders, it never executes fetched content. Unit tests cover
reconstructand the fixture (quiet 404 fallback, loud fallback on failures, per-version cache).