Skip to content

Commit

Permalink
added Relay test relay auth key to testt
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Feb 14, 2024
1 parent f4262ea commit 5dea97e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prjob_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: Install cover
run: go get golang.org/x/tools/cmd/cover
- name: Tests
run: go test ./... -race -v -coverprofile=coverage.out && ./cover-check.sh coverage.out 8.4
run: RELAY_AUTH_KEY=TEST go test ./... -race -v -coverprofile=coverage.out && ./cover-check.sh coverage.out 8.4
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Run unit tests with coverage:
// you may need to install cover with this command first
go get golang.org/x/tools/cmd/cover
// run test
go test ./... -tags mock -race -v -coverprofile=coverage.out && ./cover-check.sh coverage.out <min coverage amount>
RELAY_AUTH_KEY=TEST go test ./... -tags mock -race -v -coverprofile=coverage.out && ./cover-check.sh coverage.out <min coverage amount>
// To get code coverage in html format do the following after running the code above
go tool cover -html="coverage.out"
```
Expand Down Expand Up @@ -147,12 +147,12 @@ brew upgrade mockery

#### When adding a new function to the interface which is already mocked follow the below steps

1. Update the corresponding interface with the function signature, for example if you are adding new function to the ```database``` structure make sure the interface file ```db/interface.go``` is updated with the function signature.
2. run the command ```mockery``` to update the mocks.
1. Update the corresponding interface with the function signature, for example if you are adding new function to the `database` structure make sure the interface file `db/interface.go` is updated with the function signature.
2. run the command `mockery` to update the mocks.

#### To create mocks for a new interface make follow the steps below

1. Add the new entry in the ```.mockery.yml``` file like this
1. Add the new entry in the `.mockery.yml` file like this

```yml

Expand All @@ -168,7 +168,7 @@ packages:
*your-interface-2*:
```

2. run the command ```mockery``` to update the mocks.
2. run the command `mockery` to update the mocks.

### Backend API Data Validations

Expand Down
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func InitConfig() {
}
}

func CheckRelayAuthKey(authKey string) {

}

func StripSuperAdmins(adminStrings string) []string {
superAdmins := []string{}
if adminStrings != "" {
Expand Down
4 changes: 0 additions & 4 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ func TestInitConfig(t *testing.T) {
if JwtKey == "" {
t.Error("Could not load random jwtKey")
}

if RelayAuthKey != "" {
t.Error("Could not load RelayAuthKey")
}
}

func TestGenerateRandomString(t *testing.T) {
Expand Down

0 comments on commit 5dea97e

Please sign in to comment.