Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate profiling tests to github actions #2783

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 0 additions & 251 deletions .circleci/continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3226,90 +3226,6 @@ jobs:
paths:
- datadog-profiling

"profiling tests":
working_directory: ~/datadog
parameters:
docker_image:
type: string
triplet:
type: string
resource_class:
type: string
default: large # mostly for more RAM for ramdisk
<<: *BARE_DOCKER_MACHINE
environment:
- CARGO_TARGET_DIR: /mnt/ramdisk/cargo
steps:
- restore_cache:
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- git_checkout
- <<: *STEP_ATTACH_WORKSPACE
- setup_docker:
docker_image: << parameters.docker_image >>
ramdisk: true
- restore_cache:
name: Restore Cargo Package Cache
keys:
- cargo-cache-<< parameters.triplet >>-{{ checksum "Cargo.lock" }}
- run:
name: cargo tests
command: |
if [ -d '/opt/rh/devtoolset-7' ] ; then
set +eo pipefail
source scl_source enable devtoolset-7
set -eo pipefail
fi
set -u
command -v switch-php && switch-php "${PHP_VERSION}"
cd profiling
cargo test --release --all-features
- run:
name: phpt tests NTS
command: |
set -u
command -v switch-php && switch-php "${PHP_VERSION}"
set -e
libdir="/tmp/datadog-profiling"
cd profiling
cargo build --release --all-features
cd tests
# don't anticipate there being more than one
run_tests_php=$(find $(php-config --prefix) -name run-tests.php)
cp -v "${run_tests_php}" .
export TEST_PHP_EXECUTABLE=$(which php)
php run-tests.php -d "extension=/mnt/ramdisk/cargo/release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt"
- run:
name: phpt tests ZTS
command: |
set -u
command -v switch-php && switch-php "${PHP_VERSION}-zts"
set -e
libdir="/tmp/datadog-profiling"
cd profiling
touch build.rs #make sure `build.rs` gets executed after `switch-php` call
cargo build --release --all-features
cd tests
# don't anticipate there being more than one
run_tests_php=$(find $(php-config --prefix) -name run-tests.php)
cp -v "${run_tests_php}" .
export TEST_PHP_EXECUTABLE=$(which php)
php run-tests.php -d "extension=/mnt/ramdisk/cargo/release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt"

- run:
name: clippy NTS (for select platforms)
command: |
if [[ "x86_64-unknown-linux-gnu" != "<< parameters.triplet >>" ]] ; then
exit 0
fi
set -u
command -v switch-php && switch-php "${PHP_VERSION}"
set -e
cd profiling
touch build.rs
sed -i -e "s/crate-type.*$/crate-type = [\"rlib\"]/g" Cargo.toml
cargo clippy --all-targets --all-features -- -D warnings -Aunknown-lints

"compile_loader":
working_directory: ~/datadog
parameters:
Expand Down Expand Up @@ -5851,170 +5767,3 @@ workflows:
resource_class:
- medium
- arm.medium

profiling_tests:
when: << pipeline.parameters.profiling >>
jobs:
- "profiling tests":
name: "Profiler test PHP v7.1 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.1"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v7.1 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.1"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v7.2 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.2"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v7.2 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.2"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v7.3 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.3"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v7.3 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.3"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v7.4 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.4"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v7.4 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-7.4"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.0 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.0"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v8.0 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.0"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.1 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.1"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v8.1 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.1"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.2 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.2"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v8.2 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.2"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.3 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.3"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v8.3 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.3"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.4 - x86_64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.4"
triplet: "x86_64-alpine-linux-musl"
- "profiling tests":
name: "Profiler test PHP v8.4 - aarch64-alpine-linux-musl"
docker_image: "datadog/dd-trace-ci:php-compile-extension-alpine-8.4"
triplet: "aarch64-alpine-linux-musl"
resource_class: "arm.medium"

- "profiling tests":
name: "Profiler test PHP v7.1 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.1_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v7.1 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.1_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v7.2 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.2_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v7.2 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.2_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v7.3 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.3_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v7.3 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.3_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v7.4 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.4_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v7.4 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-7.4_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.0 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.0_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v8.0 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.0_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.1 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.1_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v8.1 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.1_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.2 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.2_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v8.2 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.2_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.3 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.3_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v8.3 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.3_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
- "profiling tests":
name: "Profiler test PHP v8.4 - x86_64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.4_centos-7"
triplet: "x86_64-unknown-linux-gnu"
- "profiling tests":
name: "Profiler test PHP v8.4 - aarch64-unknown-linux-gnu"
docker_image: "datadog/dd-trace-ci:php-8.4_centos-7"
triplet: "aarch64-unknown-linux-gnu"
resource_class: "arm.medium"
128 changes: 128 additions & 0 deletions .github/workflows/prof_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Profiling Tests

on:
push:
branches:
- main
pull_request:

defaults:
run:
shell: /bin/bash -eo pipefail {0}

jobs:
profiling-tests:
strategy:
matrix:
docker_image:
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.1"
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.2"
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.3"
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.4"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.0"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.1"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.2"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.3"
- "datadog/dd-trace-ci:php-7.1_buster"
- "datadog/dd-trace-ci:php-7.2_buster"
- "datadog/dd-trace-ci:php-7.3_buster"
- "datadog/dd-trace-ci:php-7.4_buster"
- "datadog/dd-trace-ci:php-8.0_buster"
- "datadog/dd-trace-ci:php-8.1_buster"
- "datadog/dd-trace-ci:php-8.2_buster"
- "datadog/dd-trace-ci:php-8.3_buster"
architecture:
- x86_64
- aarch64
runs-on: ${{ matrix.architecture == 'aarch64' && 'arm-8core-linux' || 'ubuntu-latest' }}

container:
image: ${{ matrix.docker_image }}
options: --user root
volumes:
- /:/host # Jailbreak!

steps:
- name: Patch native Alpine NodeJS into Runner environment
if: contains(matrix.docker_image, 'alpine')
run: |
set -eux
apk add docker nodejs
sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release
cd /host/home/runner
ls -lah
cd /host/home/runner/runners
cd /host/home/runner/actions-runner
ls -lah
ls -lah /host/home/runner/actions-runner
ls -lah
cd /host/home/runner/runners/*/externals/
shell: sh # No bash in Alpine by default

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Restore Cargo Package Cache
id: cache
uses: actions/cache@v2
with:
path: target
key: cargo-cache-${{ matrix.docker_image }}-${{ hashFiles('Cargo.lock') }}

- name: Run cargo tests
run: |
set -eux
if [[ "${{ contains(matrix.docker_image, 'alpine') }}" == "true" ]]; then
switch_php nts
else
switch-php nts
fi
cd profiling
cargo test --release --all-features

- name: Run phpt tests NTS
run: |
set -eux
if [[ "${{ contains(matrix.docker_image, 'alpine') }}" == "true" ]]; then
switch_php nts
else
switch-php nts
fi
libdir="/tmp/datadog-profiling"
cd profiling
cargo build --release --all-features
cd tests
run_tests_php=$(find $(php-config --prefix) -name run-tests.php)
cp -v "${run_tests_php}" .
export TEST_PHP_EXECUTABLE=$(which php)
php run-tests.php -d "extension=../../target/release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt"

- name: Run phpt tests ZTS
run: |
set -eux
if [[ "${{ contains(matrix.docker_image, 'alpine') }}" == "true" ]]; then
switch_php zts
else
switch-php zts
fi
libdir="/tmp/datadog-profiling"
cd profiling
touch build.rs
cargo build --release --all-features
cd tests
run_tests_php=$(find $(php-config --prefix) -name run-tests.php)
cp -v "${run_tests_php}" .
export TEST_PHP_EXECUTABLE=$(which php)
php run-tests.php -d "extension=../../target/release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt"

# - name: Run clippy NTS (for select platforms)
# if: matrix.triplet == 'x86_64-unknown-linux-gnu'
# run: |
# set -eux
# switch-php "${PHP_VERSION}"
# cd profiling
# touch build.rs
# sed -i -e "s/crate-type.*$/crate-type = [\"rlib\"]/g" Cargo.toml
# cargo clippy --all-targets --all-features -- -D warnings -Aunknown-lints
Loading
Loading