-
Notifications
You must be signed in to change notification settings - Fork 8
108 lines (82 loc) · 2.85 KB
/
e2etests.yml
File metadata and controls
108 lines (82 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# .github/workflows/e2e-tests.yml
name: E2E Tests
on: [pull_request]
permissions:
contents: read
jobs:
replset:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Poetry
run: |
poetry config virtualenvs.create false
- name: Install Python dependencies
run: |
poetry install --no-interaction --no-root
- name: Update hosts file
run: |
echo "127.0.0.1 rs00 rs01 rs02 rs10 rs11 rs12" | sudo tee -a /etc/hosts
- name: Start source and target ReplicaSet clusters
run: |
.github/workflows/rs/run
- name: Build the project
run: |
make test-build
- name: Run tests (pytest)
run: |
export TEST_SOURCE_URI=mongodb://rs00:30000
export TEST_TARGET_URI=mongodb://rs10:30100
export TEST_PCSM_URL=http://127.0.0.1:2242
export TEST_PCSM_BIN=./bin/pcsm_test
poetry run pytest tests/test_collections.py tests/test_documents.py tests/test_indexes.py tests/test_selective.py tests/test_transactions.py
- name: Teardown Docker Compose
if: always()
run: docker compose -f .github/workflows/sh/compose.yml down
sharded:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Poetry
run: |
poetry config virtualenvs.create false
- name: Install Python dependencies
run: |
poetry install --no-interaction --no-root
- name: Update hosts file
run: |
echo "127.0.0.1 src-mongos src-cfg0 src-rs00 src-rs01 tgt-mongos tgt-cfg0 tgt-rs00 tgt-rs01" | sudo tee -a /etc/hosts
- name: Start source and target clusters
run: |
.github/workflows/sh/run
- name: Build the project
run: |
make test-build
- name: Run tests (pytest)
run: |
export TEST_SOURCE_URI=mongodb://src-mongos:27017
export TEST_TARGET_URI=mongodb://tgt-mongos:29017
export TEST_PCSM_URL=http://127.0.0.1:2242
export TEST_PCSM_BIN=./bin/pcsm_test
poetry run pytest
- name: Teardown Docker Compose
if: always()
run: docker compose -f .github/workflows/sh/compose.yml down