insert, update: opt-in dumboDocHashes — return each written document's content hash #219
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Parity Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| # CI-launched servers must not phone home; their SQL_SERVER boot events | |
| # would skew DoltHub's running-server metrics. | |
| DUMBODB_NO_METRICS: "1" | |
| jobs: | |
| parity: | |
| runs-on: ubuntu-latest | |
| services: | |
| mongo: | |
| # Pinned to the MongoDB release DumboDB is tested against; keep in | |
| # sync with internal/version MongoDBVersion and the README. Bump | |
| # deliberately to a newer 8.0.x when adopting it. | |
| image: mongo:8.0.28 | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --eval 'db.runCommand({ping:1})' --quiet" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| MONGO_URI: mongodb://localhost:27017 | |
| DUMBODB_URI: mongodb://localhost:27018 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build DumboDB | |
| run: go build -o /usr/local/bin/dumbodb ./cmd/dumbodb | |
| # The harness spawns the auth pair and replica set from a mongod binary; | |
| # the service container above only supplies the plain MONGO_URI server. | |
| - name: Install mongod binary | |
| run: | | |
| codename=$(. /etc/os-release && echo "$VERSION_CODENAME") | |
| curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc \ | |
| | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg | |
| echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu ${codename}/mongodb-org/8.0 multiverse" \ | |
| | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list | |
| sudo apt-get update | |
| # Pin to the same release as the mongo service image above. | |
| sudo apt-get install -y mongodb-org-server=8.0.28 | |
| mongod --version | |
| - name: Start DumboDB | |
| run: | | |
| dumbodb --port 27018 --data-dir /tmp/dumbodb-data > /tmp/dumbodb.log 2>&1 & | |
| echo $! > /tmp/dumbodb.pid | |
| - name: Wait for DumboDB to be ready | |
| run: | | |
| for i in $(seq 1 30); do | |
| if nc -z 127.0.0.1 27018 2>/dev/null; then | |
| echo "DumboDB ready" | |
| exit 0 | |
| fi | |
| if ! kill -0 $(cat /tmp/dumbodb.pid) 2>/dev/null; then | |
| echo "DumboDB process died:" >&2 | |
| cat /tmp/dumbodb.log >&2 | |
| exit 1 | |
| fi | |
| echo "Waiting for DumboDB ($i/30)..." | |
| sleep 2 | |
| done | |
| echo "DumboDB did not start in time. Log:" >&2 | |
| cat /tmp/dumbodb.log >&2 | |
| exit 1 | |
| # Prefer a parity-testing branch whose name matches this PR/push branch | |
| # (parallel PRs are usually developed on the same-named branch); fall | |
| # back to main when no such branch exists. | |
| - name: Resolve parity-testing branch | |
| id: parity_ref | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| CANDIDATE: ${{ github.head_ref || github.ref_name }} | |
| run: | | |
| ref=main | |
| if [ -n "$CANDIDATE" ] && [ "$CANDIDATE" != "main" ] && \ | |
| git ls-remote --exit-code --heads \ | |
| "https://x-access-token:${GH_TOKEN}@github.com/dolthub/dumbodb-parity-testing.git" \ | |
| "refs/heads/${CANDIDATE}" >/dev/null 2>&1; then | |
| ref="$CANDIDATE" | |
| echo "Matching parity-testing branch found: ${CANDIDATE}" | |
| else | |
| echo "No matching parity-testing branch; using main" | |
| fi | |
| echo "ref=${ref}" >> "$GITHUB_OUTPUT" | |
| - name: Check out parity tests | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: dolthub/dumbodb-parity-testing | |
| ref: ${{ steps.parity_ref.outputs.ref }} | |
| path: parity-testing | |
| - name: Run parity suite | |
| working-directory: parity-testing | |
| env: | |
| MONGOD_BIN: /usr/bin/mongod | |
| DUMBODB_BIN: /usr/local/bin/dumbodb | |
| run: | | |
| mkdir -p results | |
| go test ./tests/ -v -timeout 15m -json | tee results/parity.json | |
| go test ./tests/ -timeout 15m | |
| - name: Upload results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: parity-results | |
| path: parity-testing/results/ | |
| if-no-files-found: ignore |