| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- name: Docker image tests
- concurrency:
- group: docker-tests-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- workflow_call:
- inputs:
- version-emqx:
- required: true
- type: string
- version-emqx-enterprise:
- required: true
- type: string
- permissions:
- contents: read
- jobs:
- basic-tests:
- runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- profile:
- - ["emqx", "emqx/emqx:5.0.16"]
- - ["emqx-enterprise", "emqx/emqx-enterprise:5.0.1"]
- env:
- EMQX_NAME: ${{ matrix.profile[0] }}
- PKG_VSN: ${{ matrix.profile[0] == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
- EMQX_IMAGE_OLD_VERSION_TAG: ${{ matrix.profile[1] }}
- steps:
- - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
- with:
- name: ${{ env.EMQX_NAME }}-docker
- path: /tmp
- - name: load docker image
- run: |
- _EMQX_DOCKER_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-docker-${PKG_VSN}.tar.gz 2>/dev/null | sed 's/Loaded image: //g')
- echo "_EMQX_DOCKER_IMAGE_TAG=$_EMQX_DOCKER_IMAGE_TAG" >> $GITHUB_ENV
- - name: dashboard tests
- working-directory: ./scripts/ui-tests
- run: |
- set -eu
- docker compose up --abort-on-container-exit --exit-code-from selenium
- - name: test two nodes cluster with proto_dist=inet_tls in docker
- run: |
- ./scripts/test/start-two-nodes-in-docker.sh -P $_EMQX_DOCKER_IMAGE_TAG $EMQX_IMAGE_OLD_VERSION_TAG
- HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' haproxy)
- ./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
- ./scripts/test/start-two-nodes-in-docker.sh -c
- - name: cleanup
- if: always()
- working-directory: ./scripts/ui-tests
- run: |
- docker compose rm -fs
- paho-mqtt-testing:
- runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
- defaults:
- run:
- shell: bash
- env:
- EMQX_NAME: ${{ matrix.profile }}
- PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
- _EMQX_TEST_DB_BACKEND: ${{ matrix.cluster_db_backend }}
- strategy:
- fail-fast: false
- matrix:
- profile:
- - emqx
- - emqx-enterprise
- - emqx-elixir
- cluster_db_backend:
- - mnesia
- - rlog
- steps:
- - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
- with:
- name: ${{ env.EMQX_NAME }}-docker
- path: /tmp
- - name: load docker image
- run: |
- EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-docker-${PKG_VSN}.tar.gz 2>/dev/null | sed 's/Loaded image: //g')
- echo "_EMQX_DOCKER_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
- - name: run emqx
- timeout-minutes: 5
- run: |
- ./.ci/docker-compose-file/scripts/run-emqx.sh $_EMQX_DOCKER_IMAGE_TAG $_EMQX_TEST_DB_BACKEND
- - name: make paho tests
- run: |
- if ! docker exec -i python /scripts/pytest.sh "$_EMQX_TEST_DB_BACKEND"; then
- echo "DUMP_CONTAINER_LOGS_BGN"
- echo "============== haproxy =============="
- docker logs haproxy
- echo "============== node1 =============="
- docker logs node1.emqx.io
- echo "============== node2 =============="
- docker logs node2.emqx.io
- echo "DUMP_CONTAINER_LOGS_END"
- exit 1
- fi
- # simple smoke test for node_dump
- - name: test node_dump
- run: |
- docker exec -t -u root node1.emqx.io bash -c 'apt-get -y update && apt-get -y install net-tools'
- docker exec -t -u root node1.emqx.io node_dump
|