-
Notifications
You must be signed in to change notification settings - Fork 8
130 lines (100 loc) · 3.44 KB
/
e2etests.yml
File metadata and controls
130 lines (100 loc) · 3.44 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# .github/workflows/e2e-tests.yml
name: E2E Tests
on: [pull_request]
permissions:
contents: read
jobs:
replset:
name: ReplicaSet (MongoDB ${{ matrix.mongo_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mongo_version: ["6.0", "7.0", "8.0"]
env:
MONGO_VERSION: ${{ matrix.mongo_version }}
PYTEST_TIMEOUT: 60
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: |
chmod +x hack/rs/run.sh hack/util
hack/rs/run.sh
- 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 hack/rs/compose.yml down
sharded:
name: Sharded (MongoDB ${{ matrix.mongo_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mongo_version: ["8.0"] # when in matrix sharded tests are failing due to PCSM-255
env:
MONGO_VERSION: ${{ matrix.mongo_version }}
PYTEST_TIMEOUT: 60
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 src-rs10 src-rs20 tgt-mongos tgt-cfg0 tgt-rs00 tgt-rs01 tgt-rs10 tgt-rs20" | sudo tee -a /etc/hosts
- name: Start source and target clusters
run: |
chmod +x hack/sh/run.sh hack/util
hack/sh/run.sh
- 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 hack/sh/compose.yml down