diff --git a/.ci/docker-compose-file/python/pytest.sh b/.ci/docker-compose-file/python/pytest.sh index 649357cff..02aa63d1e 100755 --- a/.ci/docker-compose-file/python/pytest.sh +++ b/.ci/docker-compose-file/python/pytest.sh @@ -6,6 +6,9 @@ set -x set +e +# shellcheck disable=SC3028 disable=SC3054 +SCRIPT_DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )" + EMQX_TEST_DB_BACKEND=$1 if [ "$EMQX_TEST_DB_BACKEND" = "rlog" ] then @@ -20,7 +23,7 @@ fi apk update && apk add git curl git clone -b develop-5.0 https://github.com/emqx/paho.mqtt.testing.git /paho.mqtt.testing -pip install pytest==7.1.2 pytest-retry==1.3.0 +pip install -r "$SCRIPT_DIR/requirements.txt" pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "$TARGET_HOST" RESULT=$? diff --git a/.ci/docker-compose-file/python/requirements.txt b/.ci/docker-compose-file/python/requirements.txt new file mode 100644 index 000000000..3ed470153 --- /dev/null +++ b/.ci/docker-compose-file/python/requirements.txt @@ -0,0 +1,21 @@ +pytest-retry==1.6.1 \ + --hash=sha256:3d420afc08e61ed3be28ecbb544371041b1b8e5fea7c94eb97cefa0d4ea9825c \ + --hash=sha256:3d663159a9be4d6878705822cf27a0976f99ec1bc4f2d9494e80403b17f700f2 +pytest==7.4.4 \ + --hash=sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280 \ + --hash=sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8 +pluggy==1.3.0 \ + --hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \ + --hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7 +iniconfig==2.0.0 \ + --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ + --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 +tomli==2.0.1 \ + --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ + --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f +exceptiongroup==1.2.0 \ + --hash=sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14 \ + --hash=sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68 +packaging==23.2 \ + --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ + --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index a5c5c9343..3382bbeed 100644 --- a/.github/workflows/build_packages.yaml +++ b/.github/workflows/build_packages.yaml @@ -82,7 +82,6 @@ jobs: - macos-13 runs-on: ${{ matrix.os }} steps: - - uses: emqx/self-hosted-cleanup-action@v1.0.3 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: ${{ github.event.inputs.ref }} diff --git a/.github/workflows/build_packages_cron.yaml b/.github/workflows/build_packages_cron.yaml index ee3be30a2..43ab4936a 100644 --- a/.github/workflows/build_packages_cron.yaml +++ b/.github/workflows/build_packages_cron.yaml @@ -69,7 +69,7 @@ jobs: - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 if: success() with: - name: ${{ matrix.profile[0] }} + name: ${{ matrix.profile[0] }}-${{ matrix.os }} path: _packages/${{ matrix.profile[0] }}/ retention-days: 7 - name: Send notification to Slack @@ -114,7 +114,7 @@ jobs: - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 if: success() with: - name: ${{ matrix.profile }} + name: ${{ matrix.profile }}-${{ matrix.os }} path: _packages/${{ matrix.profile }}/ retention-days: 7 - name: Send notification to Slack diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 9021d0c86..fd982d506 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -41,7 +41,7 @@ jobs: make ensure-rebar3 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5 with: languages: ${{ matrix.language }} @@ -60,6 +60,6 @@ jobs: make deps-emqx-enterprise - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/run_helm_tests.yaml b/.github/workflows/run_helm_tests.yaml index e9ea3184f..7c81eb93e 100644 --- a/.github/workflows/run_helm_tests.yaml +++ b/.github/workflows/run_helm_tests.yaml @@ -172,7 +172,7 @@ jobs: path: paho.mqtt.testing - name: install pytest run: | - pip install pytest==7.1.2 pytest-retry==1.3.0 + pip install -r source/.ci/docker-compose-file/python/requirements.txt echo "$HOME/.local/bin" >> $GITHUB_PATH - name: run paho test timeout-minutes: 10 diff --git a/.github/workflows/scorecard.yaml b/.github/workflows/scorecard.yaml index 228dafe20..f43892d01 100644 --- a/.github/workflows/scorecard.yaml +++ b/.github/workflows/scorecard.yaml @@ -8,7 +8,9 @@ on: schedule: - cron: '25 21 * * 6' push: - branches: [ "master" ] + branches: + - master + - 'release-5[0-9]' workflow_dispatch: permissions: read-all diff --git a/.github/workflows/upload-helm-charts.yaml b/.github/workflows/upload-helm-charts.yaml index 2fb26b412..1125be3a4 100644 --- a/.github/workflows/upload-helm-charts.yaml +++ b/.github/workflows/upload-helm-charts.yaml @@ -45,7 +45,7 @@ jobs: echo "version=$(./pkg-vsn.sh emqx-enterprise)" >> $GITHUB_OUTPUT ;; esac - - uses: emqx/push-helm-action@v1.1 + - uses: emqx/push-helm-action@5ca37070f42cf874fc843a0e0c7c10ac76de5255 # v1.1 if: github.event_name == 'release' && !github.event.release.prerelease with: charts_dir: "${{ github.workspace }}/deploy/charts/${{ steps.profile.outputs.profile }}" diff --git a/scripts/pkg-tests.sh b/scripts/pkg-tests.sh index e6ab05d11..02d55c986 100755 --- a/scripts/pkg-tests.sh +++ b/scripts/pkg-tests.sh @@ -91,7 +91,7 @@ emqx_prepare(){ *) ;; esac - pip3 install pytest + pip3 install -r "$CODE_PATH/scripts/pytest.requirements.txt" } emqx_test(){ diff --git a/scripts/pytest.requirements.txt b/scripts/pytest.requirements.txt new file mode 100644 index 000000000..4ad0806dc --- /dev/null +++ b/scripts/pytest.requirements.txt @@ -0,0 +1,20 @@ +pytest==7.0.1 \ + --hash=sha256:9ce3ff477af913ecf6321fe337b93a2c0dcf2a0a1439c43f5452112c1e4280db +pluggy==1.0.0 \ + --hash=sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3 +iniconfig==1.1.1 \ + --hash=sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3 +tomli==1.2.3 \ + --hash=sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c +packaging==21.3 \ + --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 +importlib-metadata==0.12 \ + --hash=sha256:37bbea81dec44d1ff72d58a1b5c1599a9f3436537f33e9e26f276610064c4830 +zipp==3.6.0 \ + --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc +py==1.11.0 \ + --hash=sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378 +attrs==22.2.0 \ + --hash=sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836 +pyparsing==3.1.1 \ + --hash=sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb