-
Notifications
You must be signed in to change notification settings - Fork 36
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
Testing responsibilities #103
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4a06bd
Testing responsibilies initial creation
aufi 760405e
Update responsibity matrix
aufi 1b04c37
Add notes component vs. E2E
aufi 602eee3
Update table
aufi 48bfd36
Elaborate on integr. e2e difference
aufi 8d643bd
Describe E2E as application level tests
aufi 158a97f
Update E2E->application level E2E and user focus
aufi 791d242
Add minimal alternative solution
aufi 885ff44
Update CI and outdated components
aufi df7e883
Mention test tiers
aufi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
167 changes: 167 additions & 0 deletions
167
enhancements/tackle/testing/testing-responsibilities.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
--- | ||
title: testing-responsibilities | ||
authors: | ||
- "@aufi" | ||
reviewers: | ||
- TBD | ||
approvers: | ||
- TBD | ||
creation-date: "2023-03-07" | ||
last-updated: "2023-03-07" | ||
status: provisional|implementable|implemented|deferred|rejected|withdrawn|replaced | ||
see-also: | ||
- "/enhancements/testing/high-level-summary.md" | ||
- https://github.com/konveyor/enhancements/pull/98 | ||
--- | ||
|
||
# Konveyor testing responsibilities | ||
|
||
## Release Signoff Checklist | ||
|
||
- [ ] Enhancement is `implementable` | ||
- [ ] Design details are appropriately documented from clear requirements | ||
- [ ] Test plan is defined | ||
- [ ] User-facing documentation is created | ||
|
||
## Summary | ||
|
||
Testing of Konveyor is critical to keep its quality, release stability and happiness of community. In order to accomplish that, it is needed to create, execute and maintain several kinds of tests like application level end-to-end and components-specific test suites. | ||
|
||
This enhancement should provide an introduction to Konveyor project testing strategy and define basic responsibilities for community members including developers as well as QE. | ||
|
||
## Motivation | ||
|
||
As we build an upstream community project that consists of multiple components, it is needed to ensure quality and stability of the project. One of important parts to achieve this is to have a test suite. | ||
|
||
There are multiple level of tests like unit, integration or end-to-end, those could be executed on several levels from a single component unit tests to the Konveyor end-to-end UI test suite executed by automated CI. | ||
|
||
The motivation for this enhancement is to do it in the most effective, user-focused and engineers-friendly way. | ||
|
||
### Goals | ||
|
||
The main goal is to have a consistent test suite covering most of Konveyor application features that can be executed automatically and together with component tests, results will be reported to Konveyor CI. | ||
|
||
An important part of this effort is to set expectations and basic responsibilities for Konveyor upstream community members regarding to test creation, execution and maintenance. | ||
|
||
### Non-Goals | ||
|
||
Cover downstream testing. | ||
|
||
## Proposal | ||
|
||
Let's start with kinds of tests relevant for us: | ||
- Component/repository specific **unit tests** | ||
- Tests **logic** of a single Konveyor component (hub, UI, …), doesn’t require running whole Konveyor installation or other components (like Keycloak) to be executed, but either doesn’t need it or mocking it. | ||
- Test technology/framework depends on technology used in a given component. | ||
- Unit tests are optional and if existed should be placed in the component repository. | ||
|
||
- Component/repository specific **integration tests** | ||
- Tests **logic** of features from a single Konveyor component (hub, UI, …), but requires other Konveyor components to be running in order to pass the test (e.g. testing addon via requests to Hub to trigger analysis). | ||
- Tests should be placed in the component repository. Even the test might require other Konveyor components to test given component (e.g. addon might execute integration test sending request to Hub API which triggers the tested addon action, so it is practically an end-to-end test), the main point here is to test the component, other required Konveyor components are considered to be just dependencies required to run the test. | ||
- As these tests focus on basic feature logic, assertions like expected HTTP response code, only partial check of returned data, etc. might be acceptable here. | ||
|
||
- Konveyor **application level end-to-end tests** (with UI or API) | ||
- Tests basic **use-cases** of the Konveyor application (scenarios which real users would expect to be working, ideally matching to Polarion test cases). | ||
- Requires running Konveyor installation and covers functions of multiple components. | ||
- Test scenarios should follow expected usage of the Konveyor by its users. | ||
- Assertions in tests require higher certainity that application works from user point of view than integration tests. E.g. Application creation test might look on HTTP response code too, but must try to retrieve the created application by its returned ID as a check if it was really created. | ||
|
||
These tests should be executed and maintained as described in following section. | ||
|
||
### Why such structure | ||
|
||
Component integration tests and Application level E2E (API) tests are technically nearly the same, but they serves to slightly different purposes. At some point, PRs with new feature or fix should contain a test, the test written by the PR author should prove it basically works. There might be multiple PRs across Konveyor components for given feature, each component might test just it's part (focusing if it works, don't have to care too much about setting up other data to real use-case scenario). | ||
|
||
So, even Hub might have integration test using an addon, it might not care about all different options of using the feature (e.g. for an analysis, if the setup options like RWX, different kinds of identities, etc. might matter), but that's a stuff which developer's integration tests don't have to care much. | ||
|
||
Once the feature backend/API work was (mostly) completed, QE comes to play writing tests for it. They might use similar/shared methods with integration tests, but the tests focus on building real user test flows with relevant test data matching to Polarion test steps (if possible). | ||
|
||
An ideal workflow on developers&QE cooperation on a new feature work: | ||
|
||
|Feature started ->||||| | ||
|---|---|---|---|---| | ||
|Backend dev|Push PRs to e.g.addon/analyzer including tests<br>Push PRs to Hub including tests|||| | ||
|UI dev||Make UI for the feature||| | ||
|QE||Work on test steps&application E2E API test|Write UI tests<br>Run sanity checks|| | ||
|||||-> Feature ready for release process| | ||
|
||
### Responsibilities | ||
|
||
#### Overview matrix | ||
|
||
| Kind of test | Primary Responsible | Presence | Executed on | Trigger (min.required) | Source code in | | ||
|---|---|---|---|---|---| | ||
| **unit** | Developers | optional | Component | PRs&push | Component repo | | ||
| **integration** | Developers | required | Component+Konveyor | PRs&push | Component repo | | ||
| **application E2E** | QE | required | Running Konveyor | time-based schedule | E2E test suite repos | | ||
|
||
#### More specific matrix as a starting point for Konveyor Hub and E2E tests | ||
|
||
| Kind of test | Responsible | Description | Tests code | Trigger (min.required) | | ||
|---|---|---|---|---| | ||
| **integration** Hub | Hub developers | REST API coverage tests, applications import, [more](https://github.com/konveyor/tackle2-hub/discussions/241) | https://github.com/konveyor/tackle2-hub/... | PR&push (+time anyway?) | | ||
| **integration** addon-windup | Addon developers | Bash-scripted windup analysis | https://github.com/konveyor/tackle2-addon-windup/blob/main/hack/test-e2e.sh | PR&push (+time anyway?) | | ||
|||||| | ||
| **application E2E** API | QE&Developers | Golang API test suite (WIP), focusing on sanity checks | https://github.com/konveyor/go-konveyor-tests | time-based schedule | | ||
| **application E2E** UI | QE&Developers | Existing QE-maintained UI test suite using cypress framework | https://github.com/konveyor/tackle-ui-tests | time-based schedule | | ||
|
||
### What Konveyor org expects from its components | ||
- Decide if unit tests are relevant for given component, if so, write it and maintain it. | ||
- Be primarily responsible for maintaining component integration tests. | ||
- Setup test actions on their components repositories and report it to Konveyor CI repo. | ||
- For new implemented features, create E2E application level test (or work with QE on it) to ensure the feature is fully working and is ready for real-world usage. | ||
|
||
### What Konveyor components should expect from Konveyor org | ||
- Provide tools for automated Konveyor installation setup (locally as well as with github actions) ready for running their integration tests on PRs (use Konveyor CI repo as a starting point). | ||
- Provide working&stable Konveyor builds (partially ensured by e2e tests). | ||
|
||
### Execution and project status | ||
|
||
Konveyor CI repository is https://github.com/konveyor/ci | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The konveyor/ci repo might not be needed if we put CI/test execution workflow badges to konveyor/tackle2-operator README. (and testing guidelines e.g. to Hub's test README or tackle2-addon) |
||
|
||
The CI repo doesn't execute test suites itself, it just display status of application E2E or components tests runs. | ||
|
||
Overall CI status is: | ||
- GREEN if all application E2E test suites and all reporting components tests are passing. | ||
- YELLOW if all application E2E test suites are passing, but some of components reporting tests are failing. | ||
- RED if some of application E2E test suites is failing. | ||
|
||
### Implementation Details/Notes/Constraints [optional] | ||
|
||
TBD technologies&resources to for re-use | ||
|
||
### Security, Risks, and Mitigations | ||
|
||
Upstream test suite must not contain any company internal information not customer data (not even as a sample data). | ||
|
||
## Design Details | ||
|
||
### Test Plan | ||
|
||
Open Konveyor upstream CI at https://github.com/konveyor/ci and tests statuses should be visible (green-ish hopefully). | ||
|
||
### Upgrade / Downgrade Strategy | ||
|
||
Tests are dependent on Konveyor application, so might need to be branched/tagged and executed together and specifically for given Konveyor version. | ||
|
||
No upgrade/downgrade actions for upstream test suite are expected. | ||
|
||
## Implementation History | ||
|
||
This is a follow-up on Dylan's Testing overview enhancement https://github.com/konveyor/enhancements/pull/98. | ||
|
||
## Drawbacks and Alternatives | ||
|
||
Since testing could be considered as QE's responsibility, developers and Konveyor component maintainers don't need to care, so we might: | ||
- not run upstream tests, leave it for downstream product builders OR | ||
- not formalize upstream testing responsibilities too much to not make it over-engineered, just put some integration tests to Hub. | ||
|
||
### A minimal working alternative | ||
|
||
As a minimal change to current state which would move us a step forward is: **Put integration (E2E) tests to Hub as a developers effort and start require tests on new features PRs.** | ||
|
||
Other things like Dev/QE cooperation on tests, application level API tests, requirements on type of tests, etc. would not be implemented. | ||
|
||
## Infrastructure Needed | ||
|
||
Github actions with Minikube should be enough for upstream tests executions. |
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.
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.
Draft PR with Hub API tests: konveyor/tackle2-hub#268