From 216e0d3595d6510421da9707c43c7a0ed319a7a8 Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Sat, 10 Feb 2024 01:39:38 -0300 Subject: [PATCH 1/2] chore: add mongo 7 to testing matrix --- .github/workflows/migrations-check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/migrations-check.yml b/.github/workflows/migrations-check.yml index fb66cfe775cb..68023a6f4b09 100644 --- a/.github/workflows/migrations-check.yml +++ b/.github/workflows/migrations-check.yml @@ -19,7 +19,7 @@ jobs: # within the global constraint i.e. Django==4.2.8 in current case # because we have global constraint of Django<4.2 django-version: ["pinned"] - mongo-version: ["4"] + mongo-version: ["4", "7"] mysql-version: ["8"] services: mongo: @@ -27,9 +27,9 @@ jobs: ports: - 27017:27017 # Note: Calling mongo here only works with mongo 4, in newer versions of mongo - # we'll have to use `mongosh` + # we'll have to use `mongosh`, hence the 'which mongosh mongo'. options: >- - --health-cmd "mongo --quiet --eval 'db.runCommand(\"ping\")'" + --health-cmd "$(which mongosh mongo) --quiet --eval 'db.runCommand(\"ping\")'" --health-interval 10s --health-timeout 5s --health-retries 3 From dcdb59831fe61931196c4e2f68bb10abf1ff74ce Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Sat, 17 Feb 2024 00:16:21 -0300 Subject: [PATCH 2/2] chore: add testing matrix to other workflows --- .github/workflows/static-assets-check.yml | 14 ++++++++++++++ .github/workflows/unit-tests-gh-hosted.yml | 7 +++++-- .github/workflows/unit-tests.yml | 15 ++++++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/static-assets-check.yml b/.github/workflows/static-assets-check.yml index 37c70a5c1362..5aedfdf52f73 100644 --- a/.github/workflows/static-assets-check.yml +++ b/.github/workflows/static-assets-check.yml @@ -16,6 +16,20 @@ jobs: python-version: [ 3.8 ] node-version: [ 16 ] npm-version: [ 8.5.x ] + mongo-version: ["4.4", "7.0"] + + services: + mongo: + image: mongo:${{ matrix.mongo-version }} + ports: + - 27017:27017 + # Note: Calling mongo here only works with mongo 4, in newer versions of mongo + # we'll have to use `mongosh`, hence the 'which mongosh mongo'. + options: >- + --health-cmd "$(which mongosh mongo) --quiet --eval 'db.runCommand(\"ping\")'" + --health-interval 10s + --health-timeout 5s + --health-retries 3 steps: - name: Checkout repo diff --git a/.github/workflows/unit-tests-gh-hosted.yml b/.github/workflows/unit-tests-gh-hosted.yml index 60dabbbecec8..b9681db67f46 100644 --- a/.github/workflows/unit-tests-gh-hosted.yml +++ b/.github/workflows/unit-tests-gh-hosted.yml @@ -36,7 +36,10 @@ jobs: - "common-with-cms" - "xmodule-with-lms" - "xmodule-with-cms" - name: gh-hosted-python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }} + mongo-version: + - "4.4" + - "7.0" + name: gh-hosted-python-${{ matrix.python-version }},django-${{ matrix.django-version }},mongo-${{ matrix.mongo-version }}${{ matrix.shard_name }} steps: - uses: actions/checkout@v2 @@ -46,7 +49,7 @@ jobs: - name: Start MongoDB uses: supercharge/mongodb-github-action@1.7.0 with: - mongodb-version: 4.4 + mongodb-version: ${{ matrix.mongo-version}} - name: Setup Python uses: actions/setup-python@v4 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index be7e122f2fd8..d08dc1aadc81 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,7 +8,7 @@ on: jobs: run-tests: - name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }} + name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},mongo-${{ matrix.mongo-version }},${{ matrix.shard_name }} if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) runs-on: [ edx-platform-runner ] strategy: @@ -36,6 +36,9 @@ jobs: - "common-with-cms" - "xmodule-with-lms" - "xmodule-with-cms" + mongo-version: + - "4.4" + - "7.0" # We expect Django 4.0 to fail, so don't stop when it fails. continue-on-error: ${{ matrix.django-version == '4.0' }} @@ -43,6 +46,16 @@ jobs: - name: sync directory owner run: sudo chown runner:runner -R .* + - name: install mongo version + run: | + if [[ "${{ matrix.mongo-version }}" != "4.4" ]]; then + sudo apt-get purge -y "mongodb-org*" + sudo apt-get remove -y mongodb-org + wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongo-version }}.asc | sudo apt-key add - + echo "deb https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${{ matrix.mongo-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongo-version }}.list + sudo apt-get update && sudo apt-get install -y mongodb-org="${{ matrix.mongo-version }}.*" + fi + - name: checkout repo uses: actions/checkout@v3