Skip to content

Commit

Permalink
update unit test for hcl gcp config
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Oct 23, 2024
1 parent 3c4af9e commit d618c40
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion util/backup_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestHclDecodeConfig(test *testing.T) {
}
vaultConfig := *config.VaultConfig
awsConfig := *config.AWSConfig
gcpConfig := *config.GCPConfig
expectedVaultConfig := VaultConfig{
Address: "https://127.0.0.1",
Insecure: true,
Expand All @@ -27,13 +28,19 @@ func TestHclDecodeConfig(test *testing.T) {
S3Bucket: "my_bucket",
S3Prefix: "prefix",
}
expectedGCPConfig := GCPConfig{
CSBucket: "my_bucket",
CSPrefix: "prefix",
}

if vaultConfig != expectedVaultConfig || awsConfig != expectedAWSConfig || !config.SnapshotCleanup {
if vaultConfig != expectedVaultConfig || awsConfig != expectedAWSConfig || gcpConfig != expectedGCPConfig || !config.SnapshotCleanup {
test.Error("decoded config struct did not contain expected values")
test.Errorf("expected vault: %v", expectedVaultConfig)
test.Errorf("actual vault: %v", vaultConfig)
test.Errorf("expected aws: %v", expectedAWSConfig)
test.Errorf("actual aws: %v", awsConfig)
test.Errorf("expected gcp: %v", expectedGCPConfig)
test.Errorf("actual gcp: %v", gcpConfig)
test.Error("expected snapshot cleanup: true")
test.Errorf("actual snapshot cleanup: %t", config.SnapshotCleanup)
}
Expand Down

0 comments on commit d618c40

Please sign in to comment.