Skip to content

Commit 96f1567

Browse files
liveaverageclaude
andcommitted
Fix validation test compilation errors
Update validation tests to use new NewNebiusCredential signature: - validation_kubernetes_test.go: Use NEBIUS_SERVICE_ACCOUNT_JSON and NEBIUS_TENANT_ID - validation_network_test.go: Use NEBIUS_SERVICE_ACCOUNT_JSON and NEBIUS_TENANT_ID The new credential format expects: - serviceAccountJSON: JSON service account key (or file path) - tenantID: Nebius tenant ID Previous format used individual credential components which have been consolidated. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9284c63 commit 96f1567

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

v1/providers/nebius/validation_kubernetes_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@ import (
1111
)
1212

1313
func TestKubernetesValidation(t *testing.T) {
14+
isValidationTest := os.Getenv("VALIDATION_TEST")
1415
if isValidationTest == "" {
1516
t.Skip("VALIDATION_TEST is not set, skipping Nebius Kubernetes validation tests")
1617
}
1718

1819
testUserPrivateKeyPEMBase64 := os.Getenv("TEST_USER_PRIVATE_KEY_PEM_BASE64")
20+
serviceAccountJSON := os.Getenv("NEBIUS_SERVICE_ACCOUNT_JSON")
21+
tenantID := os.Getenv("NEBIUS_TENANT_ID")
1922

20-
if privateKeyPEMBase64 == "" || publicKeyID == "" || serviceAccountID == "" || projectID == "" {
21-
t.Fatalf("NEBIUS_PRIVATE_KEY_PEM_BASE64, NEBIUS_PUBLIC_KEY_ID, NEBIUS_SERVICE_ACCOUNT_ID, and NEBIUS_PROJECT_ID must be set")
23+
if serviceAccountJSON == "" || tenantID == "" {
24+
t.Fatalf("NEBIUS_SERVICE_ACCOUNT_JSON and NEBIUS_TENANT_ID must be set")
2225
}
2326

2427
config := validation.ProviderConfig{
25-
Credential: NewNebiusCredential(fmt.Sprintf("validation-%s", t.Name()), publicKeyID, privateKeyPEMBase64, serviceAccountID, projectID),
28+
Credential: NewNebiusCredential(fmt.Sprintf("validation-%s", t.Name()), serviceAccountJSON, tenantID),
2629
}
2730

2831
// Use the test name as the name of the cluster and node group

v1/providers/nebius/validation_network_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,22 @@ import (
1010
)
1111

1212
var (
13-
isValidationTest = os.Getenv("VALIDATION_TEST")
14-
privateKeyPEMBase64 = os.Getenv("NEBIUS_PRIVATE_KEY_PEM_BASE64")
15-
publicKeyID = os.Getenv("NEBIUS_PUBLIC_KEY_ID")
16-
serviceAccountID = os.Getenv("NEBIUS_SERVICE_ACCOUNT_ID")
17-
projectID = os.Getenv("NEBIUS_PROJECT_ID")
13+
isValidationTest = os.Getenv("VALIDATION_TEST")
14+
serviceAccountJSON = os.Getenv("NEBIUS_SERVICE_ACCOUNT_JSON")
15+
tenantID = os.Getenv("NEBIUS_TENANT_ID")
1816
)
1917

2018
func TestNetworkValidation(t *testing.T) {
2119
if isValidationTest == "" {
2220
t.Skip("VALIDATION_TEST is not set, skipping Nebius Network validation tests")
2321
}
2422

25-
if privateKeyPEMBase64 == "" || publicKeyID == "" || serviceAccountID == "" || projectID == "" {
26-
t.Fatalf("NEBIUS_PRIVATE_KEY_PEM_BASE64, NEBIUS_PUBLIC_KEY_ID, NEBIUS_SERVICE_ACCOUNT_ID, and NEBIUS_PROJECT_ID must be set")
23+
if serviceAccountJSON == "" || tenantID == "" {
24+
t.Fatalf("NEBIUS_SERVICE_ACCOUNT_JSON and NEBIUS_TENANT_ID must be set")
2725
}
2826

2927
config := validation.ProviderConfig{
30-
Credential: NewNebiusCredential(fmt.Sprintf("validation-%s", t.Name()), publicKeyID, privateKeyPEMBase64, serviceAccountID, projectID),
28+
Credential: NewNebiusCredential(fmt.Sprintf("validation-%s", t.Name()), serviceAccountJSON, tenantID),
3129
}
3230

3331
// Use the test name as the name of the VPC

0 commit comments

Comments
 (0)