Skip to content

PCSM-203: Target cluster chunk pre-split #809

PCSM-203: Target cluster chunk pre-split

PCSM-203: Target cluster chunk pre-split #809

Workflow file for this run

# .github/workflows/e2e-tests.yml
name: E2E Tests
on: [pull_request]
permissions:
contents: read
jobs:
replset:
name: ReplicaSet (${{ matrix.src_mongo_version }} → ${{ matrix.tgt_mongo_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- src_mongo_version: "6.0"
tgt_mongo_version: "6.0"
- src_mongo_version: "7.0"
tgt_mongo_version: "7.0"
- src_mongo_version: "8.0"
tgt_mongo_version: "8.0"
- src_mongo_version: "6.0"
tgt_mongo_version: "7.0"
- src_mongo_version: "6.0"
tgt_mongo_version: "8.0"
- src_mongo_version: "7.0"
tgt_mongo_version: "8.0"
env:
SRC_MONGO_VERSION: ${{ matrix.src_mongo_version }}
TGT_MONGO_VERSION: ${{ matrix.tgt_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 tests/test_pipeline_updates.py
- name: Teardown Docker Compose
if: always()
run: docker compose -f hack/rs/compose.yml down
sharded:
name: Sharded (${{ matrix.src_mongo_version }} → ${{ matrix.tgt_mongo_version }}${{ matrix.name_suffix }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- src_mongo_version: "6.0"
tgt_mongo_version: "6.0"
- src_mongo_version: "7.0"
tgt_mongo_version: "7.0"
- src_mongo_version: "8.0"
tgt_mongo_version: "8.0"
- src_mongo_version: "6.0"
tgt_mongo_version: "7.0"
- src_mongo_version: "6.0"
tgt_mongo_version: "8.0"
- src_mongo_version: "7.0"
tgt_mongo_version: "8.0"
# Unequal shard counts (3 source, 2 target) exercise the size-weighted
# chunk pre-split path. Scoped to the presplit suite to keep CI time down.
- src_mongo_version: "8.0"
tgt_mongo_version: "8.0"
src_shards: "3"
tgt_shards: "2"
name_suffix: " 3v2 shards"
pytest_args: "tests/test_presplit_sharded.py"
env:
SRC_MONGO_VERSION: ${{ matrix.src_mongo_version }}
TGT_MONGO_VERSION: ${{ matrix.tgt_mongo_version }}
SRC_SHARDS: ${{ matrix.src_shards }}
TGT_SHARDS: ${{ matrix.tgt_shards }}
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)
env:
# Defaults to the full sharded suite; a matrix entry may scope it to a
# subset (e.g. the presplit-only run on an unequal topology).
PYTEST_ARGS: ${{ matrix.pytest_args }}
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
if [ -n "$PYTEST_ARGS" ]; then
poetry run pytest $PYTEST_ARGS
else
# test_clone_auto_segment_size_not_byte_count is RS-only; the bug it
# guards is topology-agnostic and the profiler helpers in tests/testing.py
# only support replica sets. See the test's docstring for details.
poetry run pytest --deselect tests/test_documents.py::test_clone_auto_segment_size_not_byte_count
fi
- name: Teardown Docker Compose
if: always()
run: docker compose -f hack/sh/compose.yml down