-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cloudflare worker tests for analytics-node (#967)
- Loading branch information
1 parent
e01fb23
commit d8e922d
Showing
13 changed files
with
1,254 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Integration Tests for @segment/analytics-node | ||
|
||
## Tests | ||
| Test Path | Description | | ||
| ---- | ----------- | | ||
| [./src/durability-tests](src/durability-tests/) | Test that all the events created by the Analytics SDK end up as HTTP Requests, and that graceful shutdown does not result in events getting lost. | | ||
| [./src/perf-tests](src/perf-tests/) | These tests confirm that performance has not regresssed relative to the old SDK or from the baseline (which a handler _without_ analytics). | ||
|
||
| Test Path | Description | | ||
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [./src/durability-tests](src/durability-tests/) | Test that all the events created by the Analytics SDK end up as HTTP Requests, and that graceful shutdown does not result in events getting lost. | | ||
| [./src/perf-tests](src/perf-tests/) | These tests confirm that performance has not regresssed relative to the old SDK or from the baseline (which a handler _without_ analytics). | | ||
| [./src/cloudflare-tests/](src/cloudflare-tests/) | These tests confirm that the SDK runs as expected in cloudflare workers. | | ||
|
||
Build deps and run tests: | ||
|
||
```sh | ||
yarn turbo run --filter=node-integration-tests test # from repo root | ||
``` | ||
|
||
|
||
|
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,3 @@ | ||
const { createJestTSConfig } = require('@internal/config') | ||
|
||
module.exports = createJestTSConfig(__dirname) |
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 |
---|---|---|
|
@@ -10,16 +10,20 @@ | |
"durability": "yarn ts-node src/durability-tests/durability-tests.ts", | ||
"concurrently": "yarn run -T concurrently", | ||
"ts-node": "yarn run -T ts-node", | ||
"test": "yarn perf && yarn durability" | ||
"test:perf-and-durability": "yarn perf && yarn durability", | ||
"test:cloudflare-workers": "yarn run -T jest src/cloudflare-tests" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20231002.0", | ||
"@internal/config": "workspace:^", | ||
"@internal/test-helpers": "workspace:^", | ||
"@segment/analytics-node": "workspace:^", | ||
"@types/analytics-node": "^3.1.9", | ||
"@types/autocannon": "^7", | ||
"@types/node": "^16", | ||
"analytics-node": "^6.2.0", | ||
"autocannon": "^7.10.0" | ||
"autocannon": "^7.10.0", | ||
"wrangler": "^3.11.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Oops, something went wrong.