From 131eeab8164633412cf15109e7d98fab5ce46dc3 Mon Sep 17 00:00:00 2001 From: Krishna Dutt Panchagnula Date: Mon, 5 Jun 2023 20:56:17 +0530 Subject: [PATCH] Fixed issue with Github client tests timing out (#906) * added new function to deal with the merge testing Signed-off-by: krishnaduttPanchagnula * changed the build tag Signed-off-by: krishnaduttPanchagnula * added new workflow to run on-merge step seperately Signed-off-by: krishnaduttPanchagnula * moved integration-merge-test to seperate pipeline Signed-off-by: krishnaduttPanchagnula * added new function to deal with the merge testing Signed-off-by: krishnaduttPanchagnula * changed the build tag Signed-off-by: krishnaduttPanchagnula * added new workflow to run on-merge step seperately Signed-off-by: krishnaduttPanchagnula * moved integration-merge-test to seperate pipeline Signed-off-by: krishnaduttPanchagnula * Update Makefile Co-authored-by: Mihai Maruseac Signed-off-by: krishnaduttPanchagnula * add whitespace,remove neo4j integration-merge-test Signed-off-by: krishnaduttPanchagnula --------- Signed-off-by: krishnaduttPanchagnula Co-authored-by: Mihai Maruseac --- .github/workflows/ci.yaml | 2 +- .github/workflows/postmerge.yaml | 44 +++++++++++++++++++ Makefile | 4 ++ .../client/githubclient/githubclient_test.go | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/postmerge.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1a116a5d1b..adc1533277 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,7 +59,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: make integration-test - + test-unit: runs-on: ubuntu-latest name: CI for unit tests diff --git a/.github/workflows/postmerge.yaml b/.github/workflows/postmerge.yaml new file mode 100644 index 0000000000..834d4c62d2 --- /dev/null +++ b/.github/workflows/postmerge.yaml @@ -0,0 +1,44 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Post Merge Actions + +on: + push: + branches: + - main +permissions: + contents: read + +jobs: + integration-merge-test: + # if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged + runs-on: ubuntu-latest + name: CI for Integration Merge Test + steps: + - name: Checkout code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # tag=v3 + - name: setup-go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v3.2.1 + with: + go-version: '1.19' + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + - name: Setup the project + run: go mod download + - name: Run integration merge test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: make integration-merge-test diff --git a/Makefile b/Makefile index 8750b71904..9a59258a1b 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,10 @@ test: generate integration-test: generate check-env go test -tags=integration ./... +.PHONY: integration-merge-test +integration-merge-test: generate check-env + go test -tags=integrationMerge ./... + .PHONY: check-env ifndef GITHUB_AUTH_TOKEN $(error GITHUB_AUTH_TOKEN is not set) diff --git a/internal/client/githubclient/githubclient_test.go b/internal/client/githubclient/githubclient_test.go index 42842750c6..9da264e07c 100644 --- a/internal/client/githubclient/githubclient_test.go +++ b/internal/client/githubclient/githubclient_test.go @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build integration +//go:build integrationMerge package githubclient