[test visibility] Reorg test visibility e2e tests for mocha and jest … #12086
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Lib Injection Test" | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
schedule: | |
- cron: '0 4 * * *' | |
jobs: | |
build-and-publish-init-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set Docker Image Tag | |
id: set_names | |
run: | | |
echo "Docker image tag: $(echo ${GITHUB_HEAD_REF-${GITHUB_REF#refs/heads/}} | tr / -)" | |
echo "image_name=$(echo ${GITHUB_HEAD_REF-${GITHUB_REF#refs/heads/}} | tr / -)" >> $GITHUB_OUTPUT | |
- name: Npm pack for injection image | |
run: | | |
npm pack | |
- uses: ./.github/actions/injection | |
with: | |
init-image-version: ${GITHUB_SHA} | |
- name: Push snapshot image | |
run: | | |
docker buildx build --platform=linux/amd64,linux/arm/v7,linux/arm64/v8 -t ghcr.io/datadog/dd-trace-js/dd-lib-js-init:latest_snapshot --push lib-injection | |
if: ${{ steps.set_names.outputs.image_name }} == 'master' | |
lib-injection-tests: | |
needs: | |
- build-and-publish-init-image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
TEST_LIBRARY: nodejs | |
WEBLOG_VARIANT: sample-app | |
DOCKER_REGISTRY_IMAGES_PATH: ghcr.io/datadog | |
DOCKER_IMAGE_TAG: ${{ github.sha }} | |
BUILDX_PLATFORMS: linux/amd64 | |
steps: | |
- name: Checkout system tests | |
uses: actions/checkout@v4 | |
with: | |
repository: 'DataDog/system-tests' | |
- name: Install runner | |
uses: ./.github/actions/install_runner | |
- name: Run K8s Lib Injection Tests | |
run: ./run.sh K8S_LIB_INJECTION_BASIC | |
- name: Compress logs | |
id: compress_logs | |
if: always() | |
run: tar -czvf artifact.tar.gz $(ls | grep logs) | |
- name: Upload artifact | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: logs_k8s_lib_injection | |
path: artifact.tar.gz |