Skip to content

Commit

Permalink
🧪 Added test for staging cloud (QD-7958)
Browse files Browse the repository at this point in the history
  • Loading branch information
denispopesku authored and tiulpin committed Jan 22, 2024
1 parent 9f0c4ae commit 9db9f51
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cloud/cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@ func TestGetProjectByBadToken(t *testing.T) {
}
}

func TestGetProjectByStaging(t *testing.T) {
err := os.Setenv(QodanaEndpoint, "https://cloud.sssa-stgn.aws.intellij.net")
if err != nil {
t.Fatal(err)
}
token := os.Getenv("QODANA_TOKEN")
if token == "" {
t.Skip()
}
client := NewQdClient(token)
result := client.getProject()
switch v := result.(type) {
case APIError:
if v.StatusCode > http.StatusBadRequest {
t.Errorf("Expected status code %d, got %d", http.StatusBadRequest, v.StatusCode)
}
case RequestError:
t.Errorf("Did not expect request error: %v", v)
}
}

func TestValidateToken(t *testing.T) {
client := NewQdClient("kek")
if projectName := client.ValidateToken(); projectName != "" {
Expand Down

0 comments on commit 9db9f51

Please sign in to comment.