Skip to content

Commit

Permalink
Fixed issue with Github client tests timing out (#906)
Browse files Browse the repository at this point in the history
* added new function to deal with the merge testing

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* changed the build tag

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* added new workflow to run on-merge step seperately

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* moved integration-merge-test to seperate pipeline

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* added new function to deal with the merge testing

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* changed the build tag

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* added new workflow to run on-merge step seperately

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* moved integration-merge-test to seperate pipeline

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* Update Makefile

Co-authored-by: Mihai Maruseac <mihai.maruseac@gmail.com>
Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

* add whitespace,remove neo4j integration-merge-test

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>

---------

Signed-off-by: krishnaduttPanchagnula <krishnadutt123@gmail.com>
Co-authored-by: Mihai Maruseac <mihai.maruseac@gmail.com>
  • Loading branch information
krishnaduttPanchagnula and mihaimaruseac committed Jun 5, 2023
1 parent 08bbd69 commit 131eeab
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions .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
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/client/githubclient/githubclient_test.go
Expand Up @@ -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

Expand Down

0 comments on commit 131eeab

Please sign in to comment.