Skip to content

Commit fe05cb0

Browse files
committed
Merge branch 'e2e-and-integration-tests' into playwright-setup-v2
2 parents bc831ba + cb5f896 commit fe05cb0

File tree

37 files changed

+690
-531
lines changed

37 files changed

+690
-531
lines changed

.config/dictionaries/project.dic

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ dashmap
8585
dbeaver
8686
dbschema
8787
dbsync
88+
deadpool
8889
Debouncer
8990
Deleg
9091
delegators
9192
devnet
9293
devs
9394
DIND
95+
dockerenv
9496
dockerhub
9597
domcontentloaded
9698
Dominik
@@ -319,6 +321,7 @@ serviceworker
319321
skeletonizer
320322
slotno
321323
snackbars
324+
socat
322325
sqlfluff
323326
SRCROOT
324327
sslmode

.github/workflows/ci.yml

Lines changed: 1 addition & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# cspell: words hoverkraft
2-
31
name: CI
42

53
on:
@@ -18,10 +16,6 @@ permissions:
1816
packages: write
1917
pull-requests: write
2018

21-
env:
22-
REPORT_EXT: .junit-report.xml
23-
COVERAGE_EXT: .coverage.info
24-
2519
jobs:
2620
reject:
2721
if: ${{ !github.event.pull_request.draft }}
@@ -52,85 +46,7 @@ jobs:
5246
tests:
5347
needs: ci
5448
name: Cat-Gateway integration tests
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@v4
58-
59-
- name: Free Disk Space (Ubuntu)
60-
uses: jlumbroso/free-disk-space@main
61-
with:
62-
# this might remove tools that are actually needed,
63-
# if set to "true" but frees about 6 GB
64-
tool-cache: false
65-
# all of these default to true, but feel free to set to
66-
# "false" if necessary for your workflow
67-
android: true
68-
dotnet: false
69-
haskell: false
70-
large-packages: false
71-
docker-images: false
72-
swap-storage: true
73-
74-
- name: Install Forge
75-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
76-
with:
77-
enable_caching: "true"
78-
version: 0.21.0
79-
- name: Setup
80-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
81-
- name: Prepare artifacts
82-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
83-
with:
84-
command: run
85-
args: ./catalyst-gateway/tests/+prepare-all-images
86-
87-
- name: Running Rust integration tests
88-
if: always()
89-
run: |
90-
docker compose -f catalyst-gateway/tests/docker-compose.yml up rust-tests-runner --abort-on-container-exit --exit-code-from rust-tests-runner
91-
docker compose -f catalyst-gateway/tests/docker-compose.yml logs rust-tests-runner
92-
docker compose -f catalyst-gateway/tests/docker-compose.yml down
93-
94-
- name: Running integration API tests
95-
if: always()
96-
run: |
97-
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner
98-
docker compose -f catalyst-gateway/tests/docker-compose.yml logs api-tests-runner
99-
100-
- name: Running schemathesis tests
101-
if: always()
102-
run: |
103-
docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --abort-on-container-exit --exit-code-from schemathesis-runner
104-
docker compose -f catalyst-gateway/tests/docker-compose.yml logs schemathesis-runner
105-
106-
- name: Collecting reports
107-
if: always()
108-
run: |
109-
docker cp api-tests-runner:/poetry/junit-report.xml ./api-tests${{ env.REPORT_EXT }}
110-
docker cp api-tests-runner:/poetry/coverage.lcov ./api-tests${{ env.COVERAGE_EXT }}
111-
docker cp schemathesis-runner:/results/junit-report.xml ./schemathesis${{ env.REPORT_EXT }}
112-
113-
- name: Collect and upload test reports
114-
uses: actions/upload-artifact@v4
115-
if: always()
116-
with:
117-
name: test-reports-gateway
118-
path: "**/*${{ env.REPORT_EXT }}"
119-
if-no-files-found: error
120-
retention-days: 1
121-
122-
- name: Collect and upload test coverage
123-
uses: actions/upload-artifact@v4
124-
if: always()
125-
with:
126-
name: coverage-reports-gateway
127-
path: "**/*${{ env.COVERAGE_EXT }}"
128-
if-no-files-found: error
129-
retention-days: 1
130-
131-
- name: Shutting down all services
132-
if: always()
133-
run: docker compose -f catalyst-gateway/tests/docker-compose.yml down
49+
uses: ./.github/workflows/gateway-tests.yml
13450

13551
test_reporting:
13652
if: ${{ !github.event.pull_request.draft && always() }}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# cspell: words janitoring
2+
name: Cat Gateway integration tests
3+
4+
on:
5+
workflow_call:
6+
7+
env:
8+
REPORT_EXT: .junit-report.xml
9+
COVERAGE_EXT: .coverage.info
10+
11+
jobs:
12+
tests:
13+
name: Cat-Gateway integration tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Free Disk Space (Ubuntu)
19+
uses: jlumbroso/free-disk-space@main
20+
with:
21+
# this might remove tools that are actually needed,
22+
# if set to "true" but frees about 6 GB
23+
tool-cache: false
24+
# all of these default to true, but feel free to set to
25+
# "false" if necessary for your workflow
26+
android: true
27+
dotnet: false
28+
haskell: false
29+
large-packages: false
30+
docker-images: false
31+
swap-storage: true
32+
33+
- name: Install Forge
34+
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
35+
with:
36+
enable_caching: "true"
37+
version: 0.21.0
38+
- name: Setup
39+
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
40+
- name: Prepare artifacts
41+
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
42+
with:
43+
command: run
44+
args: ./catalyst-gateway/tests/+prepare-all-images
45+
46+
- name: Rust integration tests
47+
if: always()
48+
run: |
49+
docker compose -f catalyst-gateway/tests/docker-compose.yml up rust-tests-runner --abort-on-container-exit --exit-code-from rust-tests-runner
50+
docker compose -f catalyst-gateway/tests/docker-compose.yml down
51+
52+
- name: Schemathesis tests
53+
if: always()
54+
run: |
55+
docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --abort-on-container-exit --exit-code-from schemathesis-runner
56+
docker cp schemathesis-runner:/results/junit-report.xml ./schemathesis${{ env.REPORT_EXT }}
57+
58+
- name: Integration API tests
59+
if: always()
60+
env:
61+
API_TEST_MARKS: "preprod_indexing or unmarked"
62+
run: |
63+
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner
64+
docker cp api-tests-runner:/poetry/junit-report.xml ./api-tests${{ env.REPORT_EXT }}
65+
docker cp api-tests-runner:/poetry/coverage.lcov ./api-tests${{ env.COVERAGE_EXT }}
66+
67+
- name: Integration health tests
68+
if: always()
69+
env:
70+
API_TEST_MARKS: "health_endpoint"
71+
run: |
72+
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner
73+
74+
# Skip until bugfix https://github.com/input-output-hk/catalyst-voices/issues/3209
75+
- name: Integration health thru proxy tests
76+
if: false
77+
env:
78+
API_TEST_MARKS: "health_with_proxy_endpoint"
79+
EVENT_DB_URL: "haproxy:18080"
80+
INDEX_DB_URL: "haproxy:18090"
81+
run: |
82+
docker stop cat-gateway || true
83+
docker compose -f catalyst-gateway/tests/docker-compose.yml up haproxy --detach
84+
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner
85+
86+
- name: Collect and upload test reports
87+
uses: actions/upload-artifact@v4
88+
if: always()
89+
with:
90+
name: test-reports-gateway
91+
path: "**/*${{ env.REPORT_EXT }}"
92+
if-no-files-found: error
93+
retention-days: 1
94+
95+
- name: Collect and upload test coverage
96+
uses: actions/upload-artifact@v4
97+
if: always()
98+
with:
99+
name: coverage-reports-gateway
100+
path: "**/*${{ env.COVERAGE_EXT }}"
101+
if-no-files-found: error
102+
retention-days: 1

catalyst-gateway/bin/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ tracing-subscriber = { version = "0.3.18", features = [
3535
serde_json = { version = "1.0.132", features = ["arbitrary_precision"] }
3636
thiserror = "1.0.68"
3737
chrono = "0.4.38"
38-
bb8 = "0.8.6"
39-
bb8-postgres = "0.8.1"
38+
deadpool = "0.12.2"
39+
deadpool-postgres = "0.14.1"
4040
tokio-postgres = { version = "0.7.12", features = [
4141
"with-chrono-0_4",
4242
"with-serde_json-1",

catalyst-gateway/bin/src/cli.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
use std::{io::Write, path::PathBuf, time::Duration};
33

44
use clap::Parser;
5-
use tracing::{debug, error, info};
5+
use tracing::{error, info};
66

77
use crate::{
88
cardano::start_followers,
9-
db::{self, event::EventDB, index::session::CassandraSession},
9+
db::{self, index::session::CassandraSession},
1010
service::{
1111
self,
1212
utilities::health::{
@@ -55,13 +55,7 @@ impl Cli {
5555
CassandraSession::init();
5656

5757
// Initialize Event DB connection pool
58-
db::event::establish_connection_pool().await;
59-
// Test that connection is available
60-
if EventDB::connection_is_ok().await {
61-
debug!("Event DB is connected. Liveness set to true");
62-
} else {
63-
error!("Event DB connection failed");
64-
}
58+
db::event::establish_connection_pool();
6559

6660
// Start the chain indexing follower.
6761
start_followers().await?;

0 commit comments

Comments
 (0)