Skip to content

Merging to release-5.2: TT-10153 Fix OTel memory leak (#5587) #7074

Merging to release-5.2: TT-10153 Fix OTel memory leak (#5587)

Merging to release-5.2: TT-10153 Fix OTel memory leak (#5587) #7074

Workflow file for this run

name: API integration Tests
on:
pull_request:
branches:
- master
- release-**
env:
GOPRIVATE: github.com/TykTechnologies
jobs:
test:
strategy:
matrix:
go-version: [1.19.x]
platform: [ubuntu-latest]
arch: [amd64]
node-version: [15.x]
runs-on: ${{ matrix.platform }}
steps:
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Fix private module deps
env:
TOKEN: '${{ secrets.ORG_GH_TOKEN }}'
run: >
git config --global url."https://${TOKEN}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v2
with:
path: tyk
token: ${{ secrets.ORG_GH_TOKEN }}
submodules: true
- name: Check if test framework branch exists
id: check_test_branch
env:
TOKEN: '${{ secrets.ORG_GH_TOKEN }}'
run: |
echo "branch=master" >> $GITHUB_OUTPUT
if [ ! -z "${{ github.head_ref }}" ] && git ls-remote --exit-code --heads https://${TOKEN}@github.com/TykTechnologies/tyk-automated-tests ${{ github.head_ref }}; then
echo "branch=${{ github.head_ref }}" >> $GITHUB_OUTPUT
fi
if [ ! -z "${{ github.base_ref }}" ] && git ls-remote --exit-code --heads https://${TOKEN}@github.com/TykTechnologies/tyk-automated-tests ${{ github.base_ref }}; then
echo "branch=${{ github.base_ref }}" >> $GITHUB_OUTPUT
fi
if [ ! -z "${{ github.ref }}" ] && git ls-remote --exit-code --heads https://${TOKEN}@github.com/TykTechnologies/tyk-automated-tests ${{ github.ref }}; then
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
fi
- name: Checkout test repository
uses: actions/checkout@v2
with:
repository: TykTechnologies/tyk-automated-tests
token: ${{ secrets.ORG_GH_TOKEN }}
path: tyk-automated-tests
ref: ${{ steps.check_test_branch.outputs.branch }}
- name: Check if dashboard branch exists
id: check_dashboard_branch
env:
TOKEN: '${{ secrets.ORG_GH_TOKEN }}'
run: |
echo "branch=master" >> $GITHUB_OUTPUT
if [ ! -z "${{ github.head_ref }}" ] && git ls-remote --exit-code --heads https://${TOKEN}@github.com/TykTechnologies/tyk-analytics ${{ github.head_ref }}; then
echo "branch=${{ github.head_ref }}" >> $GITHUB_OUTPUT
fi
if [ ! -z "${{ github.base_ref }}" ] && git ls-remote --exit-code --heads https://${TOKEN}@github.com/TykTechnologies/tyk-analytics ${{ github.base_ref }}; then
echo "branch=${{ github.base_ref }}" >> $GITHUB_OUTPUT
fi
if [ ! -z "${{ github.ref }}" ] && git ls-remote --exit-code --heads https://${TOKEN}@github.com/TykTechnologies/tyk-analytics ${{ github.ref }}; then
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
fi
- name: Checkout dashboard
uses: actions/checkout@v2
with:
repository: TykTechnologies/tyk-analytics
token: ${{ secrets.ORG_GH_TOKEN }}
submodules: true
path: tyk-analytics
ref: ${{ steps.check_dashboard_branch.outputs.branch }}
- name: start docker compose
run: docker-compose -f ci/ci_testing_env.yml up -d
env:
TYK_DB_LICENSEKEY: ${{secrets.DASH_LICENSE}}
DASH_REPO_PATH: /home/runner/work/tyk/tyk/tyk-analytics
GW_REPO_PATH: /home/runner/work/tyk/tyk/tyk
GOPATH: /home/runner/work/tyk/tyk
GOPRIVATE: github.com/TykTechnologies
TOKEN: ${{ secrets.ORG_GH_TOKEN }}
working-directory: tyk-automated-tests
- name: Install test dependecies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
working-directory: tyk-automated-tests
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
working-directory: tyk-automated-tests
- name: Waiting for dashboard
run: |
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:3000/hello/)" != "200" ]]; do sleep 60 && echo "waiting for dashboard '$(date +"%T")'"; done
timeout-minutes: 15
- name: Test with pytest
id: test_execution
env:
TYK_TEST_BASE_URL: "http://localhost:3000/"
TYK_TEST_GW_URL: "https://localhost:8080/"
TYK_TEST_MONGODB: "tyk-mongo:27017"
TYK_TEST_REDIS: "tyk-redis"
TYK_TEST_DB_ADMIN: "12345"
TYK_TEST_GW_SECRET: "352d20ee67be67f6340b4c0605b044b7"
TYK_TEST_FEDERATION_HOST: federation
run: |
pytest
working-directory: tyk-automated-tests
timeout-minutes: 30
- name: Archive Integration tests report
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: api-test-report
path: ./tyk-automated-tests/reports/
- name: Notify slack
if: ${{ always() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.GW_SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: "Result: ${{ steps.test_execution.outcome }}"
SLACK_USERNAME: API GW test automation
SLACK_FOOTER: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|execution details>"
- name: Comment on PR
if: ${{ always() }} && github.event.issue.pull_request
uses: mshick/add-pr-comment@v1
with:
message: |
**API tests result: ${{ steps.test_execution.outcome }}** ${{ env.STATUS }}
Branch used: ${{ github.ref }}
Commit: ${{ github.event.after }} ${{ github.event.commits[0].message }}
Triggered by: ${{ github.event_name }} (@${{ github.actor }})
[Execution page](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
repo-token: ${{ secrets.ORG_GH_TOKEN }}
allow-repeats: true
env:
STATUS: "${{ steps.test_execution.outcome == 'success' && ':white_check_mark:' || ':no_entry_sign:' }}"
- name: Xray update
if: ${{ always() }} && github.event_name != 'pull_request'
run: |
./update_xray.sh
working-directory: tyk-automated-tests
env:
TEST: "QA-901"
STATUS: "${{ steps.test_execution.outcome }}"
CLIENT_ID: ${{secrets.XRAY_CLIENT_ID}}
CLIENT_SECRET: ${{secrets.XRAY_CLIENT_SECRET}}
BRANCH: ${{ github.ref }}
- name: Getting gateway logs on failure
if: ${{ failure() }}
run: docker logs tyk-gateway