Skip to content

Commit

Permalink
Merge pull request #681 from newrelic/dev
Browse files Browse the repository at this point in the history
Release 10.11 Amendment
  • Loading branch information
ZNeumann authored Jun 16, 2023
2 parents aa4740a + bd40c35 commit f5f0661
Show file tree
Hide file tree
Showing 34 changed files with 530 additions and 2,182 deletions.
173 changes: 173 additions & 0 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# Copyright 2020 New Relic Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#

name: run-integration-tests
run-name: Testing ${{ inputs.origin }}:${{ inputs.ref }} (by @${{ github.actor }})

on:
workflow_dispatch:
inputs:
origin:
description: 'newrelic-php-agent origin'
required: true
default: 'newrelic'
type: string
ref:
description: 'Branch or tag'
required: true
default: 'dev'
type: string

jobs:
build-test-runner:
runs-on: ubuntu-latest
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-go
IMAGE_VERSION: ${{vars.MAKE_GO_VERSION}}
strategy:
matrix:
platform: [gnu, musl]
arch: [amd64, arm64]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
with:
path: php-agent
- name: Enable arm64 emulation
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build integration_runner
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/php-agent":"/usr/local/src/newrelic-php-agent"
-e ACCOUNT_supportability=${{secrets.ACCOUNT_SUPPORTABILITY}}
-e APP_supportability=${{secrets.APP_SUPPORTABILITY}}
$IMAGE_NAME:$IMAGE_TAG-${{ matrix.platform }}-$IMAGE_VERSION bin/integration_runner
- name: Save integration_runner for integration tests
uses: actions/upload-artifact@v3
with:
name: integration_runner-${{matrix.platform}}-${{matrix.arch}}
path: php-agent/bin/integration_runner
build-agent:
runs-on: ubuntu-latest
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-php
IMAGE_VERSION: ${{vars.MAKE_PHP_VERSION}}
strategy:
matrix:
platform: [gnu, musl]
arch: [amd64, arm64]
php: ['8.0', '8.1', '8.2']
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
path: php-agent
- name: Enable arm64 emulation
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build axiom
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/php-agent":"/usr/local/src/newrelic-php-agent"
$IMAGE_NAME:$IMAGE_TAG-${{matrix.php}}-${{matrix.platform}}-$IMAGE_VERSION make axiom
- name: Build agent
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/php-agent":"/usr/local/src/newrelic-php-agent"
$IMAGE_NAME:$IMAGE_TAG-${{matrix.php}}-${{matrix.platform}}-$IMAGE_VERSION make agent
- name: Save newrelic.so for integration tests
uses: actions/upload-artifact@v3
with:
name: newrelic.so-${{matrix.platform}}-${{matrix.arch}}-${{matrix.php}}
path: php-agent/agent/modules/newrelic.so
test:
needs: [build-test-runner, build-agent]
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
platform: [gnu, musl]
arch: [amd64, arm64]
php: ['8.0', '8.1', '8.2']
experimental: [false]
include:
- arch: arm64
experimental: true
steps:
- name: Checkout integration tests
uses: actions/checkout@v3
with:
path: php-agent
- name: Get integration_runner
uses: actions/download-artifact@v3
with:
name: integration_runner-${{matrix.platform}}-${{matrix.arch}}
path: php-agent/bin
- name: Get newrelic.so
uses: actions/download-artifact@v3
with:
name: newrelic.so-${{matrix.platform}}-${{matrix.arch}}-${{matrix.php}}
path: php-agent/agent/modules
- name: Prep artifacts for use
run: |
chmod 755 php-agent/bin/integration_runner
chmod 755 php-agent/agent/modules/newrelic.so
- name: Enable arm64 emulation
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Start services
env:
PHP: ${{matrix.php}}
LIBC: ${{matrix.platform}}
PLATFORM: linux/${{matrix.arch}}
AGENT_CODE: ${{github.workspace}}/php-agent
IMAGE_VERSION: ${{vars.MAKE_PHP_VERSION}}
working-directory: ./php-agent
run: |
make test-services-start
- name: Run integration tests
working-directory: ./php-agent
shell: bash
run: |
docker exec \
-e PHPS=${{matrix.php}} \
-e INTEGRATION_ARGS="-license ${{secrets.NR_TEST_LICENSE}} -collector ${{secrets.NR_COLLECTOR_HOST}} -agent agent/modules/newrelic.so" \
-e APP_supportability=${{secrets.APP_SUPPORTABILITY}} \
-e ACCOUNT_supportability=${{secrets.ACCOUNT_SUPPORTABILITY}} \
-e ACCOUNT_supportability_trusted=${{secrets.ACCOUNT_SUPPORTABILITY_TRUSTED}} \
-e SYNTHETICS_HEADER_supportability=${{secrets.SYNTHETICS_HEADER_SUPPORTABILITY}} \
nr-php make integration-tests
- name: Stop services
env:
PHP: ${{matrix.php}}
LIBC: ${{matrix.platform}}
AGENT_CODE: ${{github.workspace}}/php-agent
working-directory: ./php-agent
run: |
make test-services-stop
121 changes: 119 additions & 2 deletions .github/workflows/test-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-go
IMAGE_VERSION: v1
IMAGE_VERSION: ${{vars.MAKE_GO_VERSION}}
strategy:
matrix:
platform: [gnu, musl]
Expand All @@ -51,18 +51,25 @@ jobs:
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/php-agent":"/usr/local/src/newrelic-php-agent"
-e ACCOUNT_supportability=${{secrets.ACCOUNT_SUPPORTABILITY}}
-e APP_supportability=${{secrets.APP_SUPPORTABILITY}}
$IMAGE_NAME:$IMAGE_TAG-${{ matrix.platform }}-$IMAGE_VERSION daemon
- name: Run daemon tests
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/php-agent":"/usr/local/src/newrelic-php-agent"
$IMAGE_NAME:$IMAGE_TAG-${{ matrix.platform }}-$IMAGE_VERSION daemon_test
- name: Save integration_runner for integration tests
uses: actions/upload-artifact@v3
with:
name: integration_runner-${{matrix.platform}}-${{matrix.arch}}
path: php-agent/bin/integration_runner
agent-unit-test:
runs-on: ubuntu-latest
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-php
IMAGE_VERSION: v1
IMAGE_VERSION: ${{vars.MAKE_PHP_VERSION}}
strategy:
matrix:
platform: [gnu, musl]
Expand Down Expand Up @@ -143,3 +150,113 @@ jobs:
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/php-agent":"/usr/local/src/newrelic-php-agent"
$IMAGE_NAME:$IMAGE_TAG-${{matrix.php}}-${{matrix.platform}}-$IMAGE_VERSION make agent-${{ steps.get-check-variant.outputs.AGENT_CHECK_VARIANT }}
- name: Save newrelic.so for integration tests
uses: actions/upload-artifact@v3
with:
name: newrelic.so-${{matrix.platform}}-${{matrix.arch}}-${{matrix.php}}
path: php-agent/agent/modules/newrelic.so
integration-tests:
needs: [daemon-unit-tests, agent-unit-test]
runs-on: ubuntu-latest
strategy:
matrix:
platform: [gnu, musl]
arch: [amd64, arm64]
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
exclude:
- arch: arm64
php: '5.5'
- arch: arm64
php: '5.6'
- arch: arm64
php: '7.0'
- arch: arm64
php: '7.1'
- arch: arm64
php: '7.2'
- arch: arm64
php: '7.3'
- arch: arm64
php: '7.4'
steps:
- name: Checkout integration tests
uses: actions/checkout@v3
with:
path: php-agent
- name: Get integration_runner
uses: actions/download-artifact@v3
with:
name: integration_runner-${{matrix.platform}}-${{matrix.arch}}
path: php-agent/bin
- name: Get newrelic.so
uses: actions/download-artifact@v3
with:
name: newrelic.so-${{matrix.platform}}-${{matrix.arch}}-${{matrix.php}}
path: php-agent/agent/modules
- name: Prep artifacts for use
run: |
chmod 755 php-agent/bin/integration_runner
chmod 755 php-agent/agent/modules/newrelic.so
- name: Enable arm64 emulation
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Start services
env:
PHP: ${{matrix.php}}
LIBC: ${{matrix.platform}}
PLATFORM: linux/${{matrix.arch}}
AGENT_CODE: ${{github.workspace}}/php-agent
IMAGE_VERSION: ${{vars.MAKE_PHP_VERSION}}
working-directory: ./php-agent
run: |
make test-services-start
- name: Test events limits
working-directory: ./php-agent
shell: bash
run: |
docker exec \
-e PHPS=${{matrix.php}} \
-e INTEGRATION_ARGS="-license ${{secrets.NR_TEST_LICENSE}} -collector ${{secrets.NR_COLLECTOR_HOST}} -agent agent/modules/newrelic.so" \
nr-php make integration-events-limits
- name: Test LASP
working-directory: ./php-agent
shell: bash
run: |
docker exec \
-e PHPS=${{matrix.php}} \
-e INTEGRATION_ARGS="-license ${{secrets.NR_TEST_LICENSE}} -collector ${{secrets.NR_COLLECTOR_HOST}} -agent agent/modules/newrelic.so" \
-e LICENSE_lasp_suite_most_secure=${{secrets.LICENSE_LASP_SUITE_MOST_SECURE}} \
-e LICENSE_lasp_suite_least_secure=${{secrets.LICENSE_LASP_SUITE_LEAST_SECURE}} \
-e LICENSE_lasp_suite_random_1=${{secrets.LICENSE_LASP_SUITE_RANDOM_1}} \
-e LICENSE_lasp_suite_random_2=${{secrets.LICENSE_LASP_SUITE_RANDOM_2}} \
-e LICENSE_lasp_suite_random_3=${{secrets.LICENSE_LASP_SUITE_RANDOM_3}} \
nr-php make lasp-test-all
- name: Run integration tests
if: ${{ matrix.arch == 'amd64' }}
working-directory: ./php-agent
shell: bash
run: |
docker exec \
-e PHPS=${{matrix.php}} \
-e INTEGRATION_ARGS="-license ${{secrets.NR_TEST_LICENSE}} -collector ${{secrets.NR_COLLECTOR_HOST}} -agent agent/modules/newrelic.so" \
-e APP_supportability=${{secrets.APP_SUPPORTABILITY}} \
-e ACCOUNT_supportability=${{secrets.ACCOUNT_SUPPORTABILITY}} \
-e ACCOUNT_supportability_trusted=${{secrets.ACCOUNT_SUPPORTABILITY_TRUSTED}} \
-e SYNTHETICS_HEADER_supportability=${{secrets.SYNTHETICS_HEADER_SUPPORTABILITY}} \
nr-php make integration-tests
- name: Stop services
env:
PHP: ${{matrix.php}}
LIBC: ${{matrix.platform}}
AGENT_CODE: ${{github.workspace}}/php-agent
working-directory: ./php-agent
run: |
make test-services-stop
Loading

0 comments on commit f5f0661

Please sign in to comment.