-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'eastest' pkg with reusable test helpers
- Loading branch information
Showing
7 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package eastest contains test helpers for testing with the EAS. | ||
package eastest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package eastest | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
// SkipInCI is used to skip tests if they can not be executed in the current environment. | ||
func SkipInCI(t *testing.T) { | ||
if os.Getenv("GITHUB_ACTION") != "" { | ||
t.Skip("Tests can't currently be run in the GitHub Action environment. We will first have to make it possible to run the EAS or a mocked variant in CI") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,13 @@ import ( | |
"testing" | ||
|
||
"github.com/DEXPRO-Solutions-GmbH/easclient" | ||
"github.com/DEXPRO-Solutions-GmbH/easclient/eastest" | ||
"github.com/google/uuid" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStoreClient_GetRecordAttachment(t *testing.T) { | ||
testPrelude(t) | ||
eastest.SkipInCI(t) | ||
|
||
ctx := context.Background() | ||
user := easclient.NewUserClaims("[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,13 @@ import ( | |
"testing" | ||
|
||
"github.com/DEXPRO-Solutions-GmbH/easclient" | ||
"github.com/DEXPRO-Solutions-GmbH/easclient/eastest" | ||
"github.com/google/uuid" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStoreClient_GetRecord(t *testing.T) { | ||
testPrelude(t) | ||
eastest.SkipInCI(t) | ||
|
||
ctx := context.Background() | ||
user := easclient.NewUserClaims("[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,12 @@ import ( | |
"testing" | ||
|
||
"github.com/DEXPRO-Solutions-GmbH/easclient" | ||
"github.com/DEXPRO-Solutions-GmbH/easclient/eastest" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStoreClient_GetStoreStatus(t *testing.T) { | ||
testPrelude(t) | ||
eastest.SkipInCI(t) | ||
|
||
ctx := context.Background() | ||
user := easclient.NewUserClaims("[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,12 @@ import ( | |
"testing" | ||
|
||
"github.com/DEXPRO-Solutions-GmbH/easclient" | ||
"github.com/DEXPRO-Solutions-GmbH/easclient/eastest" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStoreClient_PutStore(t *testing.T) { | ||
testPrelude(t) | ||
eastest.SkipInCI(t) | ||
|
||
ctx := context.Background() | ||
user := easclient.NewUserClaims("[email protected]") | ||
|