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

test: [TERR-361] E2E tests for map edge coloration #44

Merged

Conversation

sanchezelton
Copy link
Contributor

@sanchezelton sanchezelton commented Aug 13, 2024

This PR adds E2E tests for testing Map Edge Coloration. It is limited to testing coloration for the default color upon panel loading as well as enabling or disabling any one or enabling all of the queries.

Implementation Notes

  • There are some small amounts of code added to support edge coloration for the adjoining use case specified in TERR-421, related to the dispatching of a custom event thresholdsChanged that is not being detected by code within Playwright's page.waitForFunction callback. (That test is implemented, but skipped).
  • The originating pubsub event for thresholds is updateMapOptions.

Checklist

  • PR Title format: type: [TERR-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

- added marcusolsson-csv-datasource to services.grafana.environment in docker-compose.yaml
- updated auth.setup and plugin.spec to test in two diffent cases: before and after Grafana 10
- updated config.info.getHostInfo to detect version of grafana via Health API and to be async function
- updated usage of above globally to use await/async
- added fileId to e2e.config for google file
- removed some unused assigned variables
- added interfaces for Topology.interface, TopologyEdge.interface, and TopologyNode.interface
- wrapped data source creation in try-catch
- removed console.log invocation
- added more reliance on built in waits and ivocation of await upon expect for visibility checks
- removed deprecated version line from docker-compose.yaml
- added sleep line to test target in Makefile to allow for container spin-up
- simplified config.info.getGoogleSheetInfo fn to only fetch data flows URL
- added topologySheetUrl to e2e.config
- refactored folderDashboardInit to defer to existing dashboard if found
- added code to add in topology via API in folderDashboardInit.getFolderDashboardTargets
- added interfaces to help better match against Dashboard and DataSource JSON schema
- added mock.panel.json for mock panel
- added makeDashboard fn to create a default dashboard
- added fetches to get topology from
e2e.config specified URL
- removed Panel.interface
- removed unneeded import for IDataSource
- refactored initCSVDatasource fn out of folderDashboardInit module into grafana-api
module as fn createDatasource
- fixed population of panel data into dashboard object structure to agree with requirements of Grafana API updateDashboard
- updated mock.panel.json to contain layer options in order to agree with NetworkMapPanel schema requirements
- fixed missing title ref in plugin.spec test for load plugin edit page - view options
- removed unneeded console.log statements
-  replaced locator for show view controls in view options test
- additional notes added in docs/development.md
…workmap-panel into feat/TERR-362-e2e-upon-empty-grafana-instance
- restored original use of showViewControlGroup to create locator
(workaround is not valid solution)
- added E2E testing workflow for CI
- remove branches specification to trigger workflows on any push or PR, no matter the branch
- updated node-version in CI to 15.x to agree with package.json
- updated on in ci.yml to delimit push event and pull_request event specifiers
- updated on in ci.yml node version to 18 for setup, but to run using 15
- set ci.yml node version for run to 15
- removed version line from docker-compose.yaml as it is deprecated
- removed setup of node on 15, trying 18 only for both build and testing
- added setup of credentials.json to ci.yml
- fix badly echoed JSON from ci.yml on E2E
- refactor E2E script into additional steps for E2E dependencies, testing param setup, and invocation of E2E via make
- change minimum required version of node to 16 for build and component testing in ci.yml
- bumped min node version required to 16 in package.json
- readded min node version required of 18 for E2E testing in ci.yml
- fixed operator to redirect stdout in overwrite mode instead of append in setup E2E testing parameter step for CI task in ci.yml
- fixed invocation of install instead of test for npx playwright step (install e2e dependencies) in ci.yml
…b.com:esnet/grafana-esnet-networkmap-panel into feat/TERR-364-ci-github-actions-integration
- added --with-deps switch on npx playwright install
- added show report task after e2e testing
- updated playwright.config to use line reporter for output in CI mode instead of html
- removed show-report (use of playwright.config to setup line reporter nullifies need for invocation)
- fixed number of workers to 1 in all environments
- configured pluginTest to serial mode for all tests
- updated documentation WRT to node versions
- fixed CSV escaping from response in order to correct format for API invocation upon data source
- updated URL to fetch CSV data
- added removeRepeats function to test/utils
- updated YAML docker-compose to use infinity datasource grafana plugin
- reconfigured config.info.getGoogleSheetInfo fn to delegate all URL computation to e2e config
- refactored e2e.config fileId out and replaced with flowSheetUrl prop
- refactored folderDashboardInit.getFolderDashboardTargets to utilize
infinity datasource plugin and reconfigure type to TSV and data flow URL.
- simplified use of getGoogleSheetInfo in grafana-api.createDatasource
- updated mock.panel and networkMapPanel JSON to use infinity plugin instead of CSV data source.
- added ITarget interface to plugin-def
- updated INetworkMapPanel interface to use a Partial<IDataSource> interface for datasource prop
- added props url and queryType in object parameter when invoking getFolderDashboardTargets.
- added props url and queryType to INetworkPanelParams
- added in loading step prior to running test (might refactor into beforeEach later)
- finished first test for "on first render of a topology loaded from a remote URL - default should be gray"
- added BasicColors.enum
- added env artifacts under .config to gitignore
- added network information, mitmproxy as transparent proxy and gateway
- mitmproxy response header injection for CORS
- updated makefile for clean and compose targets
-  refactored config.info.getHostInfo fn module to simplfy port finding
-  updated endpoints in e2e.config to use Google provided  published URLs for topology and traffic flow in TSV format
- refactored response processsing in options.targets param to pluginTest.use
- added IHostPost interface
- refactored response processing in of MapCanvas.component's maybeFetchOptions fn to support forwarding via location response header.
- added vscode files *.code-workspace to git ignore
- added ui:compose target to Makefile
- refactored default dashboard.json
- fixed missing await keyword use in auth.setup
- fixed credentials calculation by utilizing Buffer
-  added flowSheets definition to the e2e.config
- updated folderDashboardInit to use Infinity data source by default
- refactored getFolderDashboardTargets fn in module
folderDashboardInit to process thorugh flow sheets specified in e2eConfig
- added removeExistingDatasources fn in module folderDashboardInit to help maintain clear slate state when
resetting tests
- refactored createDatasource fn in grafana-api module to
allow specify of datasource name.
- added deleteDatasource fn in grafana-api module
- added deleteDashboard fn in grafana-api module
- refactored mock.panel to better align with default dashboard values when set from grafana UI.
- added IQuery interface to plugin-def module
- refactored ITarget and IPanel interfaces, PluginTest and
PluginTestOptions types in plugin-def module
- refactored DEFAULT_DATASOURCE_NAME into
plugin-def module, away from grafana-api
- added field type specifier constants in plugin-def module
- extended test edge coloration on default load tests,
to support reading of default color of SVG strokes, utilizing
elements to fetch config remote URL with 'normal'
topology, enable partial flows, and tests drivien by flow
sheet configuration in e2econfig.config.json
- added IFixtures and refactored PanelParams interfaces
- added Threshold interface to help support future
threshold color detection
- added untypedFn module to allow invoking
page.waitForEvent using custom name
- added BasicColorMatcher object for RegEx matching
- refactored MapPanel to export mapPanelWithTheme and
enable access to v18n
- expanded MapPanelProps interface to add theme to
MapPanel as React component props
- added IColumn and IFlowSheet interfaces to types.ts
- fixed typo in jsonResponseHandler in
MapCanvas.maybeFetchOptions class fn
- some code formatting in MapCanvas
- added check for thresholds in
MapCanvas.updateMapOptions to dispatch threshold
change event (to help support future emit callback for
edge color coloration changes via Grafana color picker component.
- removed some uneeded extra spacing
- added withTheme wrapper function to support use of
component with access to theme via HOC
- added vizTheme as parseData fn argument
- removed fixColor helper function in parseData exported
fn from dataParser module.
- replaced invocations of fixColor with
vizTheme.getColorByName in dataParser module
- fixed formatting of dataFrames.forEach call in dataParser module
- added checks on matchAZData and matchZAData lengths in mapJson.edges.forEach calls in parseData fn
in dataParser module
- added reverseStr helper function to utils module for tests (not src)
@sanchezelton sanchezelton self-assigned this Aug 13, 2024
@sanchezelton sanchezelton changed the base branch from main to end-to-end-tests August 13, 2024 01:47
- fixed auth setup of e2e testing under Docker by adding waitForLoadState 'networkidle'
- replaced getByRole invocations with locator invocations using an id selector
- simplified clicks on save dashboard using getByTestId
- fixed checks of stroke value validation
- updated version of package @playwright/test pinned to 1.46.1
- removed unneeded repeated invocation of both disableAllQueries and enableTargetQuery in fn
testFlowSheet supporting test 'test edge coloration on default load'
- increased test timeout to 120s
- updated lock file
- removed engines.node from package.json
- revert @playwright/test package version
- revert yarn.lock
@sanchezelton sanchezelton marked this pull request as ready for review August 19, 2024 21:55
@jkafader-esnet jkafader-esnet merged commit 430feb2 into end-to-end-tests Aug 23, 2024
2 checks passed
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