CPS Team Testing Strategy
CPS Test Overview
Over time we have developed an extensive set of tests:
- (UI) Integration test (since we don't have a UI these start at the REST layer of our components)
- CSIT Component System Integration Test. CPS utilizes Robot framework for CSIT tests..
- K6 Integration Test
- K6 Performance Tests
- Service Test (or Semi-Integration Test) using Spring Boot Test Containers for Postgress and Kafka and Mocked/Stubbed Services for external components like DMI and Policy Executor. These test are written in Groovy & Spock
- Functional
- Performance
- Unit Tests. CPS uses Groovy & Spock for unit testing
- Contract Testing
Integration Test
CSIT Integration Test
- CPS Integration Test Plan
- CSIT Testing for CPS
- Local Setup Using CSIT
- CPS-188 CSIT Testing for CPS
- Project-specific CSIT structure (non CPS page)
K6 Test Overview
<TBD>
Service / Semi-Integration Test
Persistence Testing
- CPS Persistence layer (semi-integration) testing
- Liquibase Change Log (sets) Testing (test DB Upgrade)
Contract Testing
- Contract Testing.pptx
- CPS has developed stubs for clients.
- Link to Gerrit patch: https://gerrit.onap.org/r/c/cps/+/129256
- Jira Link: - CPS-919Getting issue details... STATUS
Performance Testing
Performance Test Stubs
Performance Test Results
- CPS Basic Performance (Load) Test
- Closed issues related to CPS performance testing
Testing Frameworks
Groovy & Spock
- Groovy & Spock Test Code Conventions
- OneSummit Groovy & Spock Workshop Nov 2022 (includes sample project & exercises!)
- Additional resources:
Other Test / Verification Tools
Read the Docs (RTD)
Prerequisites
- Linux Environment (WSL works too)
- Python
- Tox (see https://tox.wiki/en/3.14.1/install.html)
Steps
- (temporary) Modify docs/tox.ini (for example https://gerrit.onap.org/r/c/cps/+/135892/2/docs/tox.ini ) do NOT merge these changes into master!
- to use YOUR python version
- If you have a lot of new documentation you can (temporary) remove
-W
flag from the first twosphinx-build
commands (sections; tox and docs-linkcheck) so it doesn't stop on the first error
(note there are always a lot of spelling 'warnings' so the third build command should always be run without the -W flag (section; docs-spellcheck)
- cd into
<your project location>docs
- run
tox
- tip: First time run can take a few minutes! use -V or -VV for more verbose output to see what it is doing
Alternate checks
- Windows Subsystem (WSL):
doc8 *.rst --ignore D002 --ignore D004
(need to ignore warnings about CR, trailing whitespace and line-length because of different filesystem) - Note. If there are unexpected issues with Linelength ie. errors locally that are not causing problems in CI then these can be ignored using
--ignore D001
Thomas Kulik suspects this might have to do with doc8 tool version and he will report back to us on this issue
Reference Material
- Ref. Martin Fowler Practical-test-pyramid
- CSIT References