This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Add E2E tests for PSP #55
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ef7d92d
Setup psp e2e test
vponline ff0b9a0
Merge branch 'process-refactor' into psp-e2e-test
vponline 72547d5
Setup build step
vponline ef0184d
Silence logger for e2e, set hardhat defaults
vponline af431cb
Fix hardhat config
vponline ca206ac
Merge branch 'process-refactor' into psp-e2e-test
vponline 0a67aff
Add fs mock, invalid test cases
vponline 1a7a863
Merge branch 'process-refactor' into psp-e2e-test
vponline 2d06339
Add subscription steps
vponline 82feb71
Mock env, fix config mocks
vponline ba1675c
Set timeout
vponline 19f3bcf
Remove beforeEach
vponline 9e43c68
Move jest timeout, fix airnodeConfig mock
vponline d18be5e
Update hardhat version - fixes missing ethereum node logs
vponline cfa23d1
Apply pr suggestions, reset hardhat network for each test, check dapi…
vponline bec52ec
Update README with test instructions
vponline dcabcd5
Add api call retry test case
vponline 236c429
Merge branch 'main' into psp-e2e-test
vponline 1a297da
Add second valid subscription
vponline d7b4ee5
Use real subscription for invalid test, remove unnecessary pm2 settings
vponline e9ea03c
Add comment about subscriptions to localConfigs
vponline 41ced4c
Refactor, move test folder
vponline 4e6665f
Add spaces to comments
vponline edc9fab
Fix hardhat file .gitignore
vponline bfb6380
Derive beaconId instead of reading from contract
vponline fa75a2e
Fix tsconfig
vponline File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
**/node_modules/** | ||
**/dist/** | ||
**/cache/** | ||
.prettierignore |
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,8 +1,12 @@ | ||
# Ignore artifacts: | ||
**/.build/** | ||
**/dist/** | ||
**/cache/** | ||
**/.serverless/** | ||
**/coverage/** | ||
|
||
**/config/*.json | ||
**/node_modules/** | ||
**/node_modules/** | ||
|
||
# Temporarily add airnode | ||
airnode |
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 |
---|---|---|
|
@@ -169,3 +169,37 @@ After that you can run the following command: | |
- `yarn run setup:psp-local`: Deploys the DapiServer contract and registers a single subscription. Use the values | ||
displayed in the console to fill in the `airkeeper.json` file. Then you can run | ||
`yarn sls:invoke-local:psp-beacon-update` to update the beacon using PSP. | ||
|
||
## Testing | ||
|
||
### Unit Tests | ||
|
||
Unit tests can then be run with: | ||
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. 🙏 Thanks |
||
|
||
```sh | ||
yarn run test | ||
``` | ||
|
||
### E2E Tests | ||
|
||
E2E tests are defined in the `test/e2e/` folder and are identified by the `feature.ts` extension. | ||
|
||
In order to run E2E tests, you will need to have both an Ethereum node and the "dummy" web API running. The simplest way | ||
to accomplish this is by running: | ||
|
||
```sh | ||
# Start an Ethereum node and mock API | ||
yarn run dev:eth-node | ||
yarn run dev:api | ||
|
||
# OR | ||
|
||
# Start both an Ethereum node and the "dummy" web API as background processes | ||
yarn run dev:background | ||
``` | ||
|
||
E2E tests can then be run with: | ||
|
||
```sh | ||
yarn run test:e2e | ||
``` |
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,13 @@ | ||
// eslint-disable-next-line functional/immutable-data | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: 'web-api', | ||
script: 'ts-node test/server/server.ts', | ||
}, | ||
{ | ||
name: 'ethereum-node', | ||
script: 'hardhat node --config test/hardhat.config.ts', | ||
}, | ||
], | ||
}; |
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,9 @@ | ||
const config = require('./jest.config'); | ||
|
||
// eslint-disable-next-line functional/immutable-data | ||
module.exports = { | ||
...config, | ||
name: 'e2e', | ||
displayName: 'e2e', | ||
testMatch: ['**/?(*.)+(feature).[tj]s?(x)'], | ||
}; |
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,9 @@ | ||
const config = require('./jest.config'); | ||
|
||
// eslint-disable-next-line functional/immutable-data | ||
module.exports = { | ||
...config, | ||
displayName: 'unit', | ||
name: 'unit', | ||
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'], | ||
}; |
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
Oops, something went wrong.
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.
We also want to add
airnode
here temprarily.