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

ci/system-tests: force run extra tests #2646

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/actions/pr-metadata/action.yml
@@ -0,0 +1,25 @@
name: 'Pull Request Metadata'
description: 'Read JSON metadata from Pull Request descriptions'
inputs:
text:
description: 'Text to parse for metadata'
required: true
outputs:
metadata:
description: "JSON metadata from the input text"
value: ${{ fromJSON(steps.parse.outputs.metadata) }}
runs:
using: "composite"
steps:
- uses: actions/setup-go@v5
with:
cache: false

- name: Parse Text Metadata
id: parse
shell: bash
run: |
set -ex
body=$(gh pr view --json body --jq '.body')
metadata=$(go run .github/actions/pr-metadata/re.go "$body")
echo "metadata=$metadata >> $GITHUB_OUTPUT
29 changes: 29 additions & 0 deletions .github/actions/pr-metadata/re.go
@@ -0,0 +1,29 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package main

import (
"fmt"
"log"
"os"
"regexp"
)

func main() {
if len(os.Args) < 2 {
log.Fatalf("Usage: %s \"<text to parse>\"", os.Args[0])
return
}

re := regexp.MustCompile(`<!--({.*})-->`)
text := os.Args[1]
matches := re.FindStringSubmatch(text)
if len(matches) <= 1 {
return
}

fmt.Println(matches[1])
}
10 changes: 6 additions & 4 deletions .github/workflows/system-tests.yml
Expand Up @@ -30,9 +30,7 @@ on:
jobs:
system-tests:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DataDog/dd-trace-go')
# Note: Not using large runners because the jobs spawned by this pipeline
# don't seem to get a noticable speedup from using larger runners.
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
strategy:
matrix:
weblog-variant:
Expand Down Expand Up @@ -116,6 +114,10 @@ jobs:
ref: ${{ inputs.branch_ref || github.ref }}
path: 'binaries/dd-trace-go'

- uses: ./binaries/dd-trace-go/.github/actions/pr-metadata
env:
GH_TOKEN: ${{ github.token }}

- name: Build weblog
run: ./build.sh -i weblog

Expand All @@ -126,7 +128,7 @@ jobs:
run: ./build.sh -i agent

- name: Run
run: env ${{ matrix.env }} ./run.sh ${{ matrix.scenario }}
run: exit 1; env ${{ matrix.env }} ./run.sh ${{ matrix.scenario }}

- name: Compress artifact
if: ${{ always() }}
Expand Down