Skip to content

Commit c4c99cd

Browse files
feature - Included the e2e into the PR workflows
Validated the presence of the GITHU_AUTH_TOKEN variable presence before running the e2e. Update the contributing doc with scopes of the personal access token. Updated the workflow to include the e2e tests.
1 parent 91bfea5 commit c4c99cd

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ jobs:
2121
run: make test
2222
- name: Build
2323
run: make build
24+
- name: Run e2e
25+
env:
26+
GITHUB_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
27+
run: |
28+
go get github.com/onsi/ginkgo/ginkgo@v1.14.2
29+
go mod download
30+
make e2e

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ Following the targets that can be used to test your changes locally.
5252
| make all | Runs go test,golangci lint checks, fmt, go mod tidy | yes |
5353
| make build | Runs go build | yes |
5454

55+
## Permission for GitHub personal access tokens
56+
57+
The personal access token need the following scopes:
58+
59+
- `repo:status` - Access commit status
60+
- `repo_deployment` - Access deployment status
61+
- `public_repo` - Access public repositories
62+
5563
## Where the CI Tests are configured
5664

5765
1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.

e2e/e2e_suite_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"net/http"
7+
"os"
78
"testing"
89

910
"github.com/google/go-github/v32/github"
@@ -32,6 +33,13 @@ func TestE2e(t *testing.T) {
3233
}
3334

3435
var _ = BeforeSuite(func() {
36+
// making sure the GITHUB_AUTH_TOKEN is set prior to running e2e tests
37+
token, contains := os.LookupEnv("GITHUB_AUTH_TOKEN")
38+
39+
Expect(contains).ShouldNot(BeFalse(),
40+
"GITHUB_AUTH_TOKEN env variable is not set.The GITHUB_AUTH_TOKEN env variable has to be set to run e2e test.")
41+
Expect(len(token)).ShouldNot(BeZero(), "Length of the GITHUB_AUTH_TOKEN env variable is zero.")
42+
3543
ctx := context.TODO()
3644

3745
logLevel := zap.LevelFlag("verbosity", zap.InfoLevel, "override the default log level")

0 commit comments

Comments
 (0)