forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update trace based tests run script (open-telemetry#1018)
* chore(tests): allow partial runs on trace-based test scripts * Adding option to run trace-based tests for selected services * Updating testing README * Fixing sanity checks * Fixing lint issues * Apply suggestions from code review Co-authored-by: Adnan Rahić <[email protected]> * Update README.md with suggestions * Updating Changelog * Fixing linter issue * Fixed changelog --------- Co-authored-by: Adnan Rahić <[email protected]> Co-authored-by: Carter Socha <[email protected]> Co-authored-by: Austin Parker <[email protected]> Co-authored-by: Juliano Costa <[email protected]>
- Loading branch information
1 parent
ba9b626
commit 740930b
Showing
5 changed files
with
71 additions
and
17 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,7 +1,49 @@ | ||
# Service Testing | ||
|
||
Testing gRPC services as black boxes. | ||
There are two ways to test the service APIs in the OpenTelemetry Demo: | ||
|
||
1. Using black box-testing, calling gRPC services | ||
and validating their direct response | ||
2. Using Trace-based tests, calling both HTTP and | ||
gRPC services and validating their direct response as well as | ||
the distributed traces they generate | ||
|
||
## Testing gRPC services as black boxes | ||
|
||
To run the entire test suite as a black box, run the command: | ||
|
||
```sh | ||
docker compose run integrationTests | ||
``` | ||
|
||
If you want to run tests for a specific service, run: | ||
|
||
1. Start the services you want to test with `docker compose up --build <service>` | ||
1. Run `npm install` | ||
1. Run `npm test` or `npx ava --match='<pattern>'` to match test names | ||
2. Run `npm install` | ||
3. Run `npm test` or `npx ava --match='<pattern>'` to match test names | ||
|
||
## Testing services with Trace-based tests | ||
|
||
To run the entire test suite of trace-based tests, run the command: | ||
|
||
```sh | ||
make run-tracetesting | ||
#or | ||
docker compose run traceBasedTests | ||
``` | ||
|
||
To run tests for specific services, pass the name of the service as a | ||
parameter (using the folder names located [here](./tracetesting/)): | ||
|
||
```sh | ||
make run-tracetesting SERVICES_TO_TEST="service-1 service-2 ..." | ||
#or | ||
docker compose run traceBasedTests "service-1 service-2 ..." | ||
``` | ||
|
||
For instance, if you need to run the tests for `ad-service` and | ||
`payment-service`, you can run them with: | ||
|
||
```sh | ||
make run-tracetesting SERVICES_TO_TEST="ad-service payment-service" | ||
``` |
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
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