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

test: github action run for integration api tests #101

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c1acec5
fix: add validation to check bridge init log producer (#98)
Romsters Nov 23, 2023
c508169
feat: add sepolia production config (#100)
vasyl-ivanchuk Nov 28, 2023
25409ae
feat: integration tests setup (#45)
Romsters Oct 10, 2023
f084f74
test: add an .env.example file with description to integration-tests
pcheremu Oct 18, 2023
7597dd2
test: adding a default action for hardhat
pcheremu Oct 18, 2023
77ae3b4
test: fix path to env
pcheremu Oct 19, 2023
7acb14f
test: exclude file existence check
pcheremu Oct 19, 2023
deb5cfd
test: create a fallback case for a default wallet
pcheremu Oct 19, 2023
91530d0
test: refactoring
pcheremu Oct 19, 2023
9507242
test: restructure test solution
abilevych Oct 24, 2023
2571b1f
test: the tokens API-related suite re-structuring
abilevych Oct 24, 2023
7eac0f8
test: the address API-related suite re-structuring
abilevych Oct 25, 2023
b03a41f
test: the transaction API-related suite re-structuring
abilevych Oct 26, 2023
e021490
chore: run lint
abilevych Oct 31, 2023
f1ea0b0
test: re-structure test suites for batches, stats, blocks endpoints
abilevych Oct 31, 2023
c24b457
chore: group the SDK-related test suites as pre-requisites
abilevych Nov 1, 2023
ed67665
chore: hooks / aligning tests suites
abilevych Nov 1, 2023
4b9ddf2
chore: implemented a global hook for jest
abilevych Nov 3, 2023
a5bc114
chore: local hooks for the addresses endpoint
abilevych Nov 3, 2023
3e3e688
chore: local hooks for the tokens endpoint
abilevych Nov 3, 2023
af6ded4
chore: local hooks for the transaction endpoint
abilevych Nov 3, 2023
e794eba
chore: add global hooks
abilevych Nov 6, 2023
5506bb1
chore: fix after lint
abilevych Nov 6, 2023
2de8c15
chore: changed timeouts in addresses api suite
abilevych Nov 7, 2023
e844b70
chore: optimized addresses/transactions test suites
abilevych Nov 7, 2023
4cd971f
test: test with a cache
pcheremu Nov 9, 2023
a28cdb2
test: test with a cleaned cache in advance
pcheremu Nov 9, 2023
d65d62a
test: test with a cache
pcheremu Nov 9, 2023
8490df6
test: refactoring
pcheremu Nov 9, 2023
955d5db
test: remove an issue workaround for husky
pcheremu Nov 9, 2023
8c7d51a
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
c30d685
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
be216cc
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 21, 2023
ec47946
chore: update the package-lock.json
abilevych Nov 22, 2023
29b878f
test: fix test for an execution on a CI
abilevych Nov 22, 2023
5412470
test: github action run for integration api tests
pcheremu Nov 28, 2023
557ee6d
test: refactoring
pcheremu Nov 28, 2023
6cc5a1a
test: refactoring
pcheremu Nov 28, 2023
5fae07e
test: refactoring
pcheremu Nov 28, 2023
5fd31c0
test: refactoring
pcheremu Nov 28, 2023
74e0056
test: refactoring
pcheremu Nov 28, 2023
8550b3f
test: refactoring
pcheremu Nov 28, 2023
db6b5de
test: refactoring
pcheremu Nov 28, 2023
6e05591
test: refactoring
pcheremu Nov 28, 2023
4e63de0
test: refactoring
pcheremu Nov 28, 2023
dfff941
test: refactoring
pcheremu Nov 28, 2023
34fb969
test: test node 18
pcheremu Nov 28, 2023
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
1 change: 1 addition & 0 deletions .github/workflows/app-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ jobs:
default_network_value_for_e2e: "/?network=mainnet"
publish_to_allure: true
environmentTags: "and not @featureEnv"

13 changes: 13 additions & 0 deletions .github/workflows/app-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ jobs:
with:
fetch-depth: 0

- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/integration-tests-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Run API integration tests
on: pull_request

jobs:
runTests:
name: Run API integration tests
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
strategy:
matrix:
node-version: ['18'] # or lts/*
test-pattern:
- addresses.test.ts
- batches.test.ts
- blocks.test.ts
- contracts.test.ts
- logs.test.ts
- stats.test.ts
- tokens.test.ts
- transactions.test.ts
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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ lerna-debug.log*
!.vscode/extensions.json

# Allure
/allure-results/
#Allure results and artifacts
**/allure-results/
**/e2e/artifacts/
**/playbook/artifacts*
**/playbook/cache*
**/buffer/*.txt

# App hyperchain config
hyperchain.config.json
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This repository is a monorepo consisting of 3 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
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: block-explorer
version: '3.8'

services:
app:
build:
Expand Down
Loading
Loading