Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusgohn committed Mar 22, 2024
1 parent 26fa211 commit b00ec21
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
10 changes: 6 additions & 4 deletions test/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func createPrefix() string {

func getCredentials(t *testing.T) *clarify.Credentials {
var creds *clarify.Credentials
var err error

username := os.Getenv("CLARIFY_USERNAME")
password := os.Getenv("CLARIFY_PASSWORD")
Expand All @@ -72,14 +71,17 @@ func getCredentials(t *testing.T) *clarify.Credentials {
creds.APIURL = endpoint
}
case credentials != "":
var err error
creds, err = clarify.CredentialsFromFile(credentials)
if err != nil {
t.Fatalf("failed to parse credentials file: %s", err)
}
default:
t.Skip("no credentials found, skipping integration tests")
}

if err != nil || creds.Validate() != nil {
t.Errorf("invalid credentials")
panic("oh no")
if err := creds.Validate(); err != nil {
t.Fatalf("invalid credentials: %s", err)
}

return creds
Expand Down
2 changes: 1 addition & 1 deletion test/data_frame_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestDataFrame(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

jsonEncode(t, result)
Expand Down
2 changes: 1 addition & 1 deletion test/evaluate_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestEvaluate(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

jsonEncode(t, result)
Expand Down
2 changes: 1 addition & 1 deletion test/insert_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestInsert(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

jsonEncode(t, result)
Expand Down
4 changes: 2 additions & 2 deletions test/publish_signals_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ func TestPublishSignals(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

// before enabling this i need to move away from using automation to using the publish signals function directly.
// FIXME: before enabling this i need to move away from using automation to using the publish signals function directly.
// jsonEncode(t, result)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/save_signals_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestSaveSignals(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

jsonEncode(t, result)
Expand Down
2 changes: 1 addition & 1 deletion test/select_items_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestSelectItems(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

jsonEncode(t, result)
Expand Down
2 changes: 1 addition & 1 deletion test/select_signals_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestSelectSignal(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %v", err)
} else if !tc.expectedFields(result) {
t.Errorf("bugs!")
t.Errorf("unexpected field found!")
}

jsonEncode(t, result)
Expand Down

0 comments on commit b00ec21

Please sign in to comment.