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

feat: [TERR-313][TERR-325] Integration test harness #26

Merged
merged 21 commits into from
Mar 20, 2024

Conversation

sanchezelton
Copy link
Contributor

Description

This adds an integration test harness between Grafana and the Engage Map plugin using Playwright and enabled tests for the following use cases:

  • Landing page (for both logged in and logged out states)
  • Navigation to dashboards page
  • Edit map view of the Network Map Plugin
  • Some basic tests for hide/show slider controls under View Options

Checklist

  • PR Title format: type: [MYESP-XXX] Short description
    • type is one of: 'build', 'ci', 'chore', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'
    • MYESP-XXX refers to a Jira issue.
    • If this is a breaking change prefix the description with "BREAKING CHANGE:"
  • There is a related Jira issue for this pull request
  • Description should be a meaningful summary of the changes you are proposing
  • For breaking changes prefix the title with "BREAKING CHANGE:" and include details in the description
  • This PR is as small as possible
  • This PR includes tests related to these changes, or existing tests provide coverage
  • This PR has updated documentation as appropriate

- initial commit for integration testing and auth for Grafana
- plugin testing code TBD
- updated Makefile with e2e targets
- updated package.json with e2e targets
- added setup and plugin dependencies for auto user sign in for e2e testing in playwright.config file
- notes on test configuration and Yarn setup added to
README
- removed commented code
- added e2e.config.json file
- data-testids attributes added to initial set of e2e tests
for targets of Grafana show/hide sliding switches for View Options
- added plugin.spec.ts for e2e testing
- refactored testid into constants module
- updated references to import of testids in
EditingInterface and MapCanvas components away from
e2e.config to constants module
- fixed use of controls vs control group click events in
plugin.spec
- updated dist modules
@sanchezelton sanchezelton changed the title feat: [MAP-160] Integration test harness feat: [TERR-133] Integration test harness Jan 23, 2024
- added makefile autogenerated e2e/grafana-docker JSON file to .gitignore
- added docker-compose to Makefile test:e2e recipe and inpsection of instance info for tests
- added CI=1 on the fly environment variables to e2e and e2e:ui scripts in package.json
- added node-fetch depedency to package.json for fetching from Grafana API endpoints
-  refactored playwright config to use auth rather than setup
as a dependency
- updated yarn.lock file
- updated auth.setup to by pass reset of default password step
during testing
- refactored getHostInfo function into its own script/module
- additional parmeters as specified in e2e.config, to be removed
- added getFolderDashboardTargets to support test fixture property setting to folderDashboardInit script
- added getDashboard, getCurrentUser, createDashboard, and createFolder functions to Grafana API service module
- added networkMapPanel.json as a base esnet-networkmap-panel
- added in plugin-def module for defining PluginTest types and fixture default values
- added getEditNetowrkMapPanelUrl function to plugin.spec
script
- removed commented code
- added interfaces for Panel and Targets
- removed unneeded console.log lines
- removed unused variable
- removed homepage and protocolHostPort props from
e2e.config
- refactored targetPanel to target first of type "esnet-networkmap-panel" in e2e.config
- added orgId to fixtures initializations for test params and ITargets interface
in getFolderDashboardTargets fn in folderDashboardInit
module
- set default value of orgId to -1
- added getHomepageUrl fn in plugin.spec
- removed cap on number of workers to 1 for e2e testing
- removed jest.config
- removed dependencies on jest in package.json
- updated yarn.lock
@sanchezelton sanchezelton marked this pull request as ready for review February 10, 2024 02:48
- updated yarn.lock
- removed jest.config from .npmignore
- remove jest and ts-jest from dependencies in package.json
- moved targetDashboardUid setting of 'pending' to before
if statement
- updated module.js and plugin.json
…l into feat/MAP-160-integration-test-harness
- removed .yarnrc and .yarnrc.yml (reverting back to 1.22.21)
- removed unneded package-lock.json (seems to have come from .npm)
- pinned ver of @swc/core to 1.3.75 for compatibility with Node >= 20
- bumped engines requirement for node >=20 and yarn >= 1.22.21 and added preinstall script hook for enforcing use
- updated yarn.lock
- removed yarn setup section in README.md (caused too many issues and belongs more in docs/development.md)
- updated yarn.lock
- added dependencies for eslint-plugin-react and eslint-plugin-jsdoc to meet minimum requirement for dev mode
- updated yarn.lock file
- readded most generated dist files
- converted functions in module.ts to use arrow notation
- fixed imports using local files with dot slash prefix in MapPanel.tsx
…l into feat/MAP-160-integration-test-harness
- updates related to resolving _this is not defined
- rolled back version of @playwright/test to 1.34.3 (and included in dev dependencies)
- updated node dependency to work with node 18
- updated lock file
- added missing step WRT to install playwright browsers
- updated config.info module in ./e2e to build basicAuthHeader using Buffer.from and Buffer.toString instead of old btoa method
- added binding of EsMap.update method via this.update.bind(this).
- aligned and pinned packages from @grafana to agree with versions as specified in Grafana 8.3.0
- updated lock file
- updated @grafana/eslint-config version to pinned 7.0.0 in package.json
- removed node-fetch related packages from package.json (relying on node v18, aka lts/hydrogen built ins)
- changed required yarn version to 1.22.0 or greater
- removed skipped tests relating to dashboard navigation (not directly within scope of plugin testing)
- removed commented code
- updated config.info.ts in e2e testing to use port in first available entry under portKeys in generated docker JSON output
- fixed bad version references to Node 18 and Yarn in development.md
@sanchezelton sanchezelton changed the title feat: [TERR-133] Integration test harness feat: [TERR-313] Integration test harness Mar 19, 2024
@sanchezelton sanchezelton changed the title feat: [TERR-313] Integration test harness feat: [TERR-313][TERR-325] Integration test harness Mar 19, 2024
- moved documentation on testing out of README.md into development.md
- updated dist copy of the README.md file to reflect that in the project root
Copy link
Collaborator

@jkafader-esnet jkafader-esnet left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@sanchezelton sanchezelton merged commit 5d7c0b5 into main Mar 20, 2024
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