diff --git a/.gitea/workflows/t.yaml b/.gitea/workflows/t.yaml new file mode 100644 index 0000000..c697920 --- /dev/null +++ b/.gitea/workflows/t.yaml @@ -0,0 +1,51 @@ +name: Integration tests + +on: + push: + branches: ['main'] + pull_request: + workflow_dispatch: + +env: + HOME: /var/lib/gitea-runner + REPO_URL: http://src.opensuse.org//git-workflow/autogits.git + +jobs: + t: + runs-on: linux-x86_64 + steps: + - name: whoami + run: whoami + - name: pwd + run: pwd + - name: vars + run: | + set | grep GITEA_ + - name: Clone + run: | + git clone -q ${{ env.REPO_URL }} + - name: Checkout + run: | + echo ${{ gitea.ref }} + git fetch origin ${{ gitea.ref }} + git checkout FETCH_HEAD + working-directory: ./autogits + - name: Prepare binaries + run: make build + working-directory: ./autogits + - name: Prepare images + run: make build + working-directory: ./autogits/integration + - name: Make sure the pod is down + run: make down + working-directory: ./autogits/integration + - name: Start images + run: make up + working-directory: ./autogits/integration + - name: Run tests + run: py.test-3.11 -v tests + working-directory: ./autogits/integration + - name: Make sure the pod is down + run: make down + working-directory: ./autogits/integration + diff --git a/.gitignore b/.gitignore index ede2242..1f67e63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.osc *.conf +!/integration/**/*.conf /integration/gitea-data /integration/gitea-logs /integration/rabbitmq-data diff --git a/integration/Makefile b/integration/Makefile index 5047bdb..f2d381f 100644 --- a/integration/Makefile +++ b/integration/Makefile @@ -44,7 +44,7 @@ build_container: # Run tests in topology 1 test_container: - podman run --rm --privileged -t --network integration_gitea-network -e GIWTF_IMAGE_SUFFIX=$(GIWTF_IMAGE_SUFFIX) autogits_integration /usr/bin/bash -c "make build && make up && sleep 25 && pytest -v tests/*" + podman run --rm --privileged -t -e GIWTF_IMAGE_SUFFIX=$(GIWTF_IMAGE_SUFFIX) autogits_integration /usr/bin/bash -c "make build && make up && sleep 25 && pytest -v tests/*" build_local: AUTO_DETECT_MODE=.local diff --git a/integration/rabbitmq-config/rabbitmq.conf b/integration/rabbitmq-config/rabbitmq.conf new file mode 100644 index 0000000..299c064 --- /dev/null +++ b/integration/rabbitmq-config/rabbitmq.conf @@ -0,0 +1,7 @@ +listeners.ssl.default = 5671 + +ssl_options.certfile = /etc/rabbitmq/certs/cert.pem +ssl_options.keyfile = /etc/rabbitmq/certs/key.pem +ssl_options.verify = verify_none +ssl_options.fail_if_no_peer_cert = false +management.load_definitions = /etc/rabbitmq/definitions.json