From ca3151b415324670b83d9f8b210847a06163c4c5 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Thu, 19 Dec 2024 15:37:32 +0000 Subject: [PATCH] temporary testing patch --- .github/workflows/build-and-test.yml | 27 +++++++++++++++++---------- Makefile | 5 +++++ Makefile.Common | 5 +++++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d2e5f23cb3c..97ca2924373 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -7,14 +7,11 @@ on: merge_group: types: [checks_requested] pull_request: - permissions: contents: read - concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true - jobs: setup-environment: runs-on: ubuntu-latest @@ -37,7 +34,6 @@ jobs: - name: Install dependencies if: steps.go-cache.outputs.cache-hit != 'true' run: make gomoddownload - lint: runs-on: ubuntu-latest needs: [setup-environment] @@ -61,7 +57,6 @@ jobs: run: make -j2 golint - name: goimpi run: make goimpi - govulncheck: runs-on: ubuntu-latest timeout-minutes: 30 @@ -86,7 +81,6 @@ jobs: run: make install-tools - name: Run `govulncheck` run: make govulncheck - checks: runs-on: ubuntu-latest needs: [setup-environment] @@ -138,7 +132,6 @@ jobs: run: | make crosslink git diff -s --exit-code || (echo 'Replace statements are out of date, please run "make crosslink" and commit the changes in this PR.' && exit 1) - unittest-matrix: strategy: matrix: @@ -170,6 +163,23 @@ jobs: - name: Run Unit Tests run: | make -j4 gotest + - name: status + run: git status + - name: deepen + run: git fetch --deepen=2 + - name: uncommit the patch + run: git reset --soft HEAD^ + - name: status + run: git status + - uses: datadog/junit-upload-github-action@v1 + if: always() + continue-on-error: true + env: + DD_GIT_BRANCH: main + with: + api-key: ${{ secrets.DD_CI_API_KEY }} + service: opentelemetry-collector + files: internal/tools/testresults/ unittest: if: always() runs-on: ubuntu-latest @@ -186,7 +196,6 @@ jobs: echo "One or more matrix jobs failed." false fi - test-coverage: runs-on: ubuntu-latest needs: [setup-environment] @@ -217,7 +226,6 @@ jobs: uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # 5.1.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - cross-build-collector: needs: [setup-environment] runs-on: ubuntu-latest @@ -251,7 +259,6 @@ jobs: goarch: 386 - goos: windows goarch: amd64 - steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/Makefile b/Makefile index 3051426403a..9facbf2b933 100644 --- a/Makefile +++ b/Makefile @@ -435,3 +435,8 @@ mdatagen-test: cd cmd/mdatagen && $(GOCMD) install . cd cmd/mdatagen && $(GOCMD) generate ./... cd cmd/mdatagen && $(GOCMD) test ./... + +.PHONY: gotest +gotest: + go install gotest.tools/gotestsum@v1.12.0 + @$(MAKE) for-all-target TARGET="test-junit" diff --git a/Makefile.Common b/Makefile.Common index 610c909eb4f..24dbe319f2f 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -99,3 +99,8 @@ impi: $(IMPI) .PHONY: moddownload moddownload: $(GOCMD) mod download + +.PHONY: test-junit +test-junit: + mkdir -p $(TOOLS_MOD_DIR)/testresults + gotestsum --junitfile $(TOOLS_MOD_DIR)/testresults/$$PWD-junit.xml -- $(GOTEST_OPT) ./...