Compare commits

..

4 commits

Author SHA1 Message Date
7a23a1aeea
Merge pull request #39 from passbolt/v5-run-workflow
Some checks are pending
Go / test (push) Waiting to run
V5 run workflow
2025-03-05 16:58:39 +01:00
867980552a
Merge pull request #38 from passbolt/auto-skip-integration-tests
Automatically Skip integration tests if no REG_URL is set
2025-03-05 16:56:22 +01:00
eaf92f3d46 Enable workflows on v5 branch 2025-03-05 16:54:47 +01:00
7ede26f1f4 Automatically Skip integration tests if no REG_URL is set 2025-03-05 16:50:18 +01:00
3 changed files with 27 additions and 16 deletions

View file

@ -2,9 +2,9 @@ name: Go
on: on:
push: push:
branches: [ main ] branches: [main, v5]
pull_request: pull_request:
branches: [ main ] branches: [main, v5]
jobs: jobs:
test: test:

View file

@ -6,6 +6,10 @@ import (
) )
func TestResourceCreate(t *testing.T) { func TestResourceCreate(t *testing.T) {
// Skip integration tests if no client is available
if client == nil {
t.SkipNow()
}
id, err := CreateResource(context.TODO(), client, "", "name", "username", "https://url.lan", "password123", "a password description") id, err := CreateResource(context.TODO(), client, "", "name", "username", "https://url.lan", "password123", "a password description")
if err != nil { if err != nil {
t.Fatalf("Creating Resource %v", err) t.Fatalf("Creating Resource %v", err)

View file

@ -15,6 +15,13 @@ var client *api.Client
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
url := os.Getenv("REG_URL") url := os.Getenv("REG_URL")
// If we don't have a URL for Creating a user, Skip all integration tests by not Providing a client
if url == "" {
fmt.Println("REG_URL Env Variable Empty, Skipping integration tests")
os.Exit(m.Run())
}
fmt.Printf("Registering with url: %v\n", url) fmt.Printf("Registering with url: %v\n", url)
userID, token, err := ParseInviteUrl(url) userID, token, err := ParseInviteUrl(url)
if err != nil { if err != nil {