Skip to content
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

feat: integration tests setup #46

Draft
wants to merge 146 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
fcde284
feat: integration tests setup (#45)
Romsters Oct 10, 2023
ee9545a
Merge branch 'main' into integration-tests
Romsters Oct 10, 2023
8ac53d9
test: add an .env.example file with description to integration-tests
pcheremu Oct 18, 2023
deb9667
test: adding a default action for hardhat
pcheremu Oct 18, 2023
19021be
test: fix path to env
pcheremu Oct 19, 2023
8040412
test: exclude file existence check
pcheremu Oct 19, 2023
3a9d961
test: create a fallback case for a default wallet
pcheremu Oct 19, 2023
6e62c51
test: refactoring
pcheremu Oct 19, 2023
5e62c42
Merge pull request #58 from matter-labs/QA-451-add-envexample-logic
pcheremu Oct 19, 2023
5dc4623
test: restructure test solution
abilevych Oct 24, 2023
1c6074e
test: the tokens API-related suite re-structuring
abilevych Oct 24, 2023
bacb018
test: the address API-related suite re-structuring
abilevych Oct 25, 2023
38723b1
test: the transaction API-related suite re-structuring
abilevych Oct 26, 2023
f18702f
chore: run lint
abilevych Oct 31, 2023
d2ea0e9
test: re-structure test suites for batches, stats, blocks endpoints
abilevych Oct 31, 2023
1730a71
chore: group the SDK-related test suites as pre-requisites
abilevych Nov 1, 2023
ca9e597
chore: hooks / aligning tests suites
abilevych Nov 1, 2023
6ed2427
chore: implemented a global hook for jest
abilevych Nov 3, 2023
cb7a237
chore: local hooks for the addresses endpoint
abilevych Nov 3, 2023
0816c80
chore: local hooks for the tokens endpoint
abilevych Nov 3, 2023
3aa0f34
chore: local hooks for the transaction endpoint
abilevych Nov 3, 2023
e848a0f
chore: add global hooks
abilevych Nov 6, 2023
4064634
chore: fix after lint
abilevych Nov 6, 2023
88cf5b3
chore: changed timeouts in addresses api suite
abilevych Nov 7, 2023
e1ecfa4
chore: optimized addresses/transactions test suites
abilevych Nov 7, 2023
96bce37
test: fix git runner and test issues
pcheremu Nov 8, 2023
cf18598
test: test with a cache
pcheremu Nov 9, 2023
d15df2c
test: test with a node
pcheremu Nov 9, 2023
43ba846
test: test with a cleaned cache in advance
pcheremu Nov 9, 2023
9c990c0
test: test with a node
pcheremu Nov 9, 2023
3b0693e
test: test with a cache
pcheremu Nov 9, 2023
19e5251
test: refactoring
pcheremu Nov 9, 2023
8831d1b
test: refactoring
pcheremu Nov 9, 2023
427d64a
test: remove an issue workaround for husky
pcheremu Nov 9, 2023
37765e0
Merge pull request #83 from matter-labs/QA-522-fix-issues-ci
abilevych Nov 9, 2023
f7ddfe6
Merge pull request #67 from matter-labs/QA-487-re-structure-tests
abilevych Nov 14, 2023
dfbd5d8
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
8b057b1
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
1bc3563
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 21, 2023
21737ce
Merge pull request #92 from matter-labs/QA-535-cover-contract-api
abilevych Nov 21, 2023
3a79075
Merge branch 'main' into QA-540-update-the-integration-test-branch
abilevych Nov 22, 2023
74383a7
chore: update the package-lock.json
abilevych Nov 22, 2023
daf1887
test: fix test for an execution on a CI
abilevych Nov 22, 2023
7fe2e5a
Merge pull request #96 from matter-labs/QA-540-update-the-integration…
abilevych Nov 22, 2023
f9d76f8
feat: integration tests setup (#45)
Romsters Oct 10, 2023
e112da4
test: add an .env.example file with description to integration-tests
pcheremu Oct 18, 2023
7e8ef57
test: adding a default action for hardhat
pcheremu Oct 18, 2023
e58f682
test: fix path to env
pcheremu Oct 19, 2023
e049159
test: exclude file existence check
pcheremu Oct 19, 2023
0646894
test: create a fallback case for a default wallet
pcheremu Oct 19, 2023
b7b433b
test: refactoring
pcheremu Oct 19, 2023
bc671e2
test: restructure test solution
abilevych Oct 24, 2023
7b1e6bc
test: the tokens API-related suite re-structuring
abilevych Oct 24, 2023
88042cf
test: the address API-related suite re-structuring
abilevych Oct 25, 2023
71050d3
test: the transaction API-related suite re-structuring
abilevych Oct 26, 2023
defde5a
chore: run lint
abilevych Oct 31, 2023
3ea13f4
test: re-structure test suites for batches, stats, blocks endpoints
abilevych Oct 31, 2023
44a1d1e
chore: group the SDK-related test suites as pre-requisites
abilevych Nov 1, 2023
de0366e
chore: hooks / aligning tests suites
abilevych Nov 1, 2023
eb3660a
chore: implemented a global hook for jest
abilevych Nov 3, 2023
d71dec4
chore: local hooks for the addresses endpoint
abilevych Nov 3, 2023
fa6c9a6
chore: local hooks for the tokens endpoint
abilevych Nov 3, 2023
5817ed0
chore: local hooks for the transaction endpoint
abilevych Nov 3, 2023
2482504
chore: add global hooks
abilevych Nov 6, 2023
a16183e
chore: fix after lint
abilevych Nov 6, 2023
5f194e3
chore: changed timeouts in addresses api suite
abilevych Nov 7, 2023
0040e2d
chore: optimized addresses/transactions test suites
abilevych Nov 7, 2023
64b9813
test: test with a cache
pcheremu Nov 9, 2023
eabd0b0
test: test with a cleaned cache in advance
pcheremu Nov 9, 2023
b121b73
test: test with a cache
pcheremu Nov 9, 2023
23e8230
test: refactoring
pcheremu Nov 9, 2023
08c70e8
test: remove an issue workaround for husky
pcheremu Nov 9, 2023
fd68f4b
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
359399d
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
ea94965
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 21, 2023
5150799
chore: update the package-lock.json
abilevych Nov 22, 2023
21ea321
Merge branch 'integration-tests' into QA-573-rebase2-be-tests
pcheremu Dec 14, 2023
c3ade7e
Refactoring of app-e2e.yml
pcheremu Dec 14, 2023
ecea709
Small refactoring artifactsSet3.feature
pcheremu Dec 14, 2023
7d93728
Merge pull request #125 from matter-labs/QA-573-rebase2-be-tests
abilevych Dec 15, 2023
e30f4b7
test: prepare run api tests on ci
pcheremu Dec 15, 2023
3355947
test: refactoring
pcheremu Dec 15, 2023
31887d0
test: update name in integration-tests-api.yml
pcheremu Dec 18, 2023
533b4ed
Merge pull request #127 from matter-labs/QA-414-ci-run-on-fixed-branch
abilevych Dec 19, 2023
d0fd386
test: initial commit with tests
pcheremu Jan 5, 2024
c4c1e61
test: eslint refactoring
pcheremu Jan 5, 2024
4b9e9ac
test: updated contract hash for ui test
pcheremu Jan 5, 2024
e0b9368
test: refactoring
pcheremu Jan 5, 2024
9136685
test: refactoring
pcheremu Jan 5, 2024
6255d26
test: fix unstable api test
pcheremu Jan 5, 2024
f9f98a3
test: fix git ignore output folders
pcheremu Jan 5, 2024
3a0f377
test: refactoring
pcheremu Jan 5, 2024
07e50cf
test: refactoring test name
pcheremu Jan 5, 2024
e8d4697
test: refactoring test name
pcheremu Jan 5, 2024
9a51b1f
tests: refactoring test names
pcheremu Jan 10, 2024
1fbd645
test: refactoring eslint
pcheremu Jan 10, 2024
2d90a71
test: refactoring names
pcheremu Jan 10, 2024
05a5367
test: fix api tests
pcheremu Jan 10, 2024
f0fa0f5
test: refactoring
pcheremu Jan 10, 2024
639ff5e
test: refactoring
pcheremu Jan 10, 2024
d26ca9d
test: refactoring
pcheremu Jan 10, 2024
a7cf0d1
test: refactoring after rebase
pcheremu Jan 10, 2024
6ef5983
test: refactoring eslint
pcheremu Jan 10, 2024
43e7a17
test: fix test names add account test to the workflow
pcheremu Jan 11, 2024
3a546fc
test: fix test names add account test to the workflow
pcheremu Jan 11, 2024
5a2e7ba
Merge branch 'QA-446-replacefixupdate2-api-tests' into QA-577-fix-uns…
abilevych Jan 16, 2024
22ec02a
test: fix eslint
pcheremu Jan 16, 2024
6c5a521
test: fix redirection to documentation
pcheremu Jan 16, 2024
50ddbac
test: fix redirection to documentation
pcheremu Jan 16, 2024
792fc08
test: fix links
pcheremu Jan 17, 2024
4a65808
Merge pull request #148 from matter-labs/QA-577-fix-unstable-tests
abilevych Jan 17, 2024
4a8abdd
test: refactoring
pcheremu Jan 17, 2024
8a14d5e
test: fix portal url
pcheremu Jan 17, 2024
3194485
Update packages/integration-tests/tests/api/accounts.test.ts
pcheremu Jan 18, 2024
86baebb
chore: update the Blocks suite name
abilevych Jan 18, 2024
c975ef7
test: fix names in tests
pcheremu Jan 18, 2024
610df0d
test: refactoring
pcheremu Jan 18, 2024
8a57793
Merge pull request #147 from matter-labs/QA-446-replacefixupdate2-api…
abilevych Jan 18, 2024
93dbc2c
chore: api retry logic for tests
abilevych Jan 11, 2024
d09ef6e
fix: lint issues
abilevych Jan 11, 2024
b3f8098
chore: changed timeouts
abilevych Jan 16, 2024
63f77d2
chore: integration api tests refactoring
abilevych Jan 17, 2024
224a338
chore: excluded unstable test
abilevych Jan 17, 2024
276ab27
chore: jest retry option, fix lint
abilevych Jan 17, 2024
6ef6d44
chore: refactoring test actualization after rebase
abilevych Jan 18, 2024
3f21529
fix: lint issue
abilevych Jan 18, 2024
ee53339
chore: exclude gating test
abilevych Jan 18, 2024
806dddb
chore: excluded unstable tests
abilevych Jan 18, 2024
c4bdcae
chore: updated retry-logic for integration api tests
abilevych Jan 23, 2024
8d374d5
fix: integration api tests for the CI run
abilevych Jan 23, 2024
c6159a3
chore: refactoring leftovers in the test solution
abilevych Jan 23, 2024
54005cf
chore: optimized integration API tests
abilevych Jan 23, 2024
c411d58
chore: refactored jest config
abilevych Jan 23, 2024
d23bd9b
chore: refactoring test retry method
abilevych Jan 24, 2024
eb0e8b6
Merge pull request #149 from matter-labs/QA-582-retry-wrapper-over-AP…
abilevych Jan 24, 2024
2a4f726
test: covering tokens API endpoints tc1803 (#155)
amelnytskyi Jan 30, 2024
91641ee
test: fix readme docker command (#158)
pcheremu Jan 30, 2024
a57a9ce
test: covering Batches API and partially covered Transactions (#156)
amelnytskyi Jan 30, 2024
c9482df
feat: new automation tests for accounts API (#163)
olehbairak Feb 6, 2024
d8daa3d
test: fixing gating transactions tests (#162)
amelnytskyi Feb 7, 2024
5708ef8
test: rebase integration tests to main (#167)
pcheremu Feb 12, 2024
a42afca
test: resolve conflicts
pcheremu Feb 13, 2024
36380a0
test: fix a new line typos
pcheremu Feb 13, 2024
ae4a4d4
test: remove a version from docker compose
pcheremu Feb 13, 2024
d186114
test: roll back the version to the docker compose file
pcheremu Feb 13, 2024
946b0f6
fix: remove docker version (#169)
vasyl-ivanchuk Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/dist/
**.env
**.env
2 changes: 0 additions & 2 deletions .github/workflows/app-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ jobs:
uses: actions/cache@v3
env:
cache-name: cache-node-modules
# Workaround for bug https://github.com/typicode/husky/issues/991
HUSKY: 0
with:
vasyl-ivanchuk marked this conversation as resolved.
Show resolved Hide resolved
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/integration-tests-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Integration test - API
on: pull_request

jobs:
runTests:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
strategy:
matrix:
node-version: ['lts/*'] # 18.17.1 or lts/*
test-pattern:
- accounts.test.ts
- addresses.test.ts
- batches.test.ts
- blocks.test.ts
- contracts.test.ts
- logs.test.ts
- stats.test.ts
- tokens.test.ts
- transactions.test.ts
name: 'API test set: ${{ matrix.test-pattern}} / Node: ${{ matrix.node-version}}'
steps:
- name: Checkout with Submodule
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: |
npm ci --no-audit
npx playwright install --with-deps chromium
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Start docker containers
run: |
docker-compose -f "docker-compose.yaml" up -d --build
- name: List running containers
run: docker ps

- name: API tests run (parallel)
run: |
cd packages/integration-tests
npx jest --verbose --testPathPattern=${{ matrix.test-pattern }}
- name: Stop containers
if: always()
run: |
docker-compose -f "docker-compose.yaml" down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ cypress/videos/
cypress/screenshots/
tests/e2e/reports/
**/tests/e2e/artifacts/
**/playbook/artifacts-zk/
**/playbook/artifacts/
**/playbook/buffer/
**/playbook/cache-zk/
**/playbook/cache/

# Logs
logs
Expand Down
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
"typescript.tsdk": "node_modules/typescript/lib",
"editor.tabSize": 2
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This repository is a monorepo consisting of 4 packages:
- [API](./packages/api) - a service providing Web API for retrieving structured [zkSync Era](https://zksync.io) blockchain data collected by [Worker](./packages/worker). It connects to the Worker's database to be able to query the collected data.
- [App](./packages/app) - a front-end app providing an easy-to-use interface for users to view and inspect transactions, blocks, contracts and more. It makes requests to the [API](./packages/api) to get the data and presents it in a way that's easy to read and understand.

Also the repository contains [integration-test](./packages/integration-tests) package with a set of API and UI tests. Follow this [Readme](./packages/integration-tests/README.md) for more details.

## 🏛 Architecture
The following diagram illustrates how are the block explorer components connected:

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ volumes:
geth:
postgres:
zksync-config:
zksync-data:
zksync-data:
Loading
Loading