Skip to content

chore(deps): update plugin com.avast.gradle.docker-compose to v0.17.7 #259

chore(deps): update plugin com.avast.gradle.docker-compose to v0.17.7

chore(deps): update plugin com.avast.gradle.docker-compose to v0.17.7 #259

Workflow file for this run

name: E2E Tests
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.svg'
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.svg'
workflow_dispatch:
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- run: |
PROBE_VERSION="$(python setup.py --version)"
echo "SPP_PROBE_VERSION=$PROBE_VERSION" >> $GITHUB_ENV
- run: ./gradlew assembleUp
- name: Docker IPs
run: docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
- name: Set E2E_APP_HOST
run: E2E_APP_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=e2e-test")) && echo "E2E_APP_HOST=$E2E_APP_HOST" >> $GITHUB_ENV
- name: Set SPP_PLATFORM_HOST
run: SPP_PLATFORM_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=spp-platform")) && echo "SPP_PLATFORM_HOST=$SPP_PLATFORM_HOST" >> $GITHUB_ENV
- name: Set SPP_JWT_TOKEN
run: until $(curl --output /dev/null --silent --fail http://localhost:12800/api/new-token?authorization_code=change-me); do printf '.'; sleep 5; done && SPP_JWT_TOKEN=$(curl http://localhost:12800/api/new-token?authorization_code=change-me) && echo "SPP_JWT_TOKEN=$SPP_JWT_TOKEN" >> $GITHUB_ENV
- name: Wait for platform
run: |
until $(curl --header "Authorization: Bearer ${{ env.SPP_JWT_TOKEN }}" --output /dev/null --silent --fail http://localhost:12800/health); do printf '.'; sleep 5; done
- run: curl -sS https://webinstall.dev/jq | bash
- run: sleep 45s #wait for services to connect; todo: use health endpoint
- name: Verify probe connected
run: |
resp=$(curl --header "Authorization: Bearer ${{ env.SPP_JWT_TOKEN }}" http://localhost:12800/clients) && [[ $(echo $resp | jq -r ."probes"[0]."meta"."language") == "python" ]] && echo $resp || (echo $resp && exit 1)
- name: Download & install spp-cli
run: |
curl -O -J -L https://github.com/sourceplusplus/interface-cli/releases/download/0.7.5/spp-cli-0.7.5-linux64.zip && unzip spp-cli-0.7.5-linux64.zip && chmod +x spp-cli && mv spp-cli /usr/local/bin/spp-cli
- name: Live breakpoint (false condition)
run: |
spp-cli -a change-me add breakpoint -c 1==2 E2ETest.py 19
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."applied") == "true" ]] && echo $resp || (echo $resp && exit 1)
curl ${{ env.E2E_APP_HOST }}:5000 && sleep 35s
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."meta"."hit_count") == "0" ]] && echo $resp || (echo $resp && exit 1)
spp-cli -a change-me remove all-instruments
- name: Live log (false condition)
run: |
spp-cli -a change-me add log -c 1==2 -l provider E2ETest.py 19 Hello {}
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."applied") == "true" ]] && echo $resp || (echo $resp && exit 1)
curl ${{ env.E2E_APP_HOST }}:5000 && sleep 35s
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."meta"."hit_count") == "0" ]] && echo $resp || (echo $resp && exit 1)
spp-cli -a change-me remove all-instruments
- name: Live breakpoint (hit limit = 2)
run: |
spp-cli -a change-me add breakpoint -hitLimit 2 E2ETest.py 19
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."applied") == "true" ]] && echo $resp || (echo $resp && exit 1)
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."hitLimit") == "2" ]] && echo $resp || (echo $resp && exit 1)
#resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."meta"."hit_count") == "0" ]] && echo $resp || (echo $resp && exit 1)
curl ${{ env.E2E_APP_HOST }}:5000 && sleep 35s
#resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."meta"."hit_count") == "1" ]] && echo $resp || (echo $resp && exit 1)
curl ${{ env.E2E_APP_HOST }}:5000 && sleep 35s
resp=$(spp-cli -a change-me get instruments) && [[ $resp == "[ ]" ]] && echo $resp || (echo $resp && exit 1)
- name: Live log (hit limit = 2)
run: |
spp-cli -a change-me add log -hitLimit 2 -l provider E2ETest.py 19 Hello {}
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."applied") == "true" ]] && echo $resp || (echo $resp && exit 1)
resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."hitLimit") == "2" ]] && echo $resp || (echo $resp && exit 1)
#resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."meta"."hit_count") == "0" ]] && echo $resp || (echo $resp && exit 1)
curl ${{ env.E2E_APP_HOST }}:5000 && sleep 35s
#resp=$(spp-cli -a change-me get instruments) && [[ $(echo $resp | jq -r .[0]."meta"."hit_count") == "1" ]] && echo $resp || (echo $resp && exit 1)
curl ${{ env.E2E_APP_HOST }}:5000 && sleep 35s
resp=$(spp-cli -a change-me get instruments) && [[ $resp == "[ ]" ]] && echo $resp || (echo $resp && exit 1)
- run: ./gradlew composeLogs
if: ${{ !cancelled() }}
- name: Upload docker logs artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: ./build/containers-logs
- name: Remove Old Release Drafts
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
| tr '\r\n' ' ' \
| jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' \
curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/{}
- name: Create Release Draft
if: github.ref == 'refs/heads/master'
id: createDraft
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.SPP_PROBE_VERSION }}
release_name: v${{ env.SPP_PROBE_VERSION }}
draft: true