-
Notifications
You must be signed in to change notification settings - Fork 12
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
Re-enable annotations e2e test #198
Conversation
Levitate is-compatible report: 🔍 Resolving @grafana/data@latest... 🔬 Checking compatibility between ./src/module.ts and @grafana/data@9.3.2... 🔬 Checking compatibility between ./src/module.ts and @grafana/ui@9.3.2... 🔬 Checking compatibility between ./src/module.ts and @grafana/runtime@9.3.2... 🔬 Checking compatibility between ./src/module.ts and @grafana/e2e-selectors@9.3.2... ✔️ ./src/module.ts appears to be compatible with @grafana/data,@grafana/ui,@grafana/runtime,@grafana/e2e-selectors |
Backend code coverage report for PR #198 |
Frontend code coverage report for PR #198
|
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.
LGTM
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.
Looks ok to me! A few questions for my own knowledge, also I think I kind of lost where the resource selector/query editor was involved? Did those changes happen elsewhere or am I just missing it lol.
@@ -6,7 +6,7 @@ services: | |||
build: | |||
context: ./.config | |||
args: | |||
grafana_version: ${GRAFANA_VERSION:-9.1.2} |
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.
just curious if this change is necessary, seems harmless, more just curious if the e2e tests use this docker file at all
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.
the e2e tests that run in ci don't use this docker file, i was using this to test the e2e locally.
@@ -37,6 +37,7 @@ export const mockDatasource = new DataSource({ | |||
type: 'athena-datasource', | |||
name: 'Athena Data Source', | |||
access: 'proxy', | |||
readOnly: false, |
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.
what did this do? I'm guessing this is just a new required field in 9.3.2?
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.
yea, new required field
const regionsResponse = await ctx.ds.getRegions(); | ||
|
||
expect(regionsResponse).toHaveLength(response.length); | ||
expect(regionsResponse).toBe(response); | ||
expect(regionsResponse).toEqual(response); |
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.
curious if this is the result of just a package update or if this is like meaningfully different in some way?
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.
the mock's response was previously set with backendSrv.get = jest.fn(() => Promise.resolve(response));
(removed line 70), but now it's set up in the beforeEach so now it's not testing for reference equality anymore.
@@ -61,61 +56,76 @@ describe('AthenaDatasource', () => { | |||
jsonData: { defaultRegion: 'testRegion', catalog: 'testCatalog', database: 'testDatabase' }, | |||
} as unknown as DataSourceInstanceSettings<AthenaDataSourceOptions>; | |||
ctx.ds = new DataSource(ctx.instanceSettings); | |||
runtime.setBackendSrv(backendSrv as runtime.BackendSrv); | |||
ctx.ds.getResource = jest.fn().mockImplementation((path: string) => { |
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.
why were these changes needed is setBackendSrv not a thing in the newer version? Looks good tho, just curious!
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.
setBackendSrv
is still a thing, but after upgrading, there were errors with needing to mock fetch
from the BackendSrv
. i didn't want to spend time mocking out the internals of the BackendSrv
.
@grafana/*
packages in order to re-enable the annotations in the e2e test. Packages are updated to v9.3.2 since there were some fixes in thee2e
ande2e-selector
packages that are needed for the tests to work.@grafana/aws-sdk
to fix a build error whereclassName
was not properly recognized as a prop onResourceSelector
used inQueryEditor.tsx
Note: to run e2e locally, you'll need to make sure you're using and npm version < 9. For more info see grafana/grafana#59425.
Fixes: #187