Skip to content

Commit 1ae622e

Browse files
log formatting
1 parent e167589 commit 1ae622e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

test/cases/nvidia-inference/main_test.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ func TestMain(m *testing.M) {
4444

4545
_, err := common.ParseFlags(&testConfig)
4646
if err != nil {
47-
log.Fatalf("failed to parse flags: %v", err)
47+
log.Fatalf("[ERROR] Failed to parse flags: %v", err)
4848
}
4949
cfg, err := envconf.NewFromFlags()
5050
if err != nil {
51-
log.Fatalf("failed to initialize test environment: %v", err)
51+
log.Fatalf("[ERROR] Failed to initialize test environment: %v", err)
5252
}
5353

5454
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
@@ -63,19 +63,19 @@ func TestMain(m *testing.M) {
6363
// Render CloudWatch Agent manifest with dynamic dimensions
6464
renderedCloudWatchAgentManifest, err := manifests.RenderCloudWatchAgentManifest(testConfig.MetricDimensions)
6565
if err != nil {
66-
log.Printf("Warning: failed to render CloudWatch Agent manifest: %v", err)
66+
log.Printf("Warning: Failed to render CloudWatch Agent manifest: %v", err)
6767
}
6868
manifestsList = append(manifestsList, manifests.DCGMExporterManifest, renderedCloudWatchAgentManifest)
6969
}
7070

7171
testenv.Setup(
7272
func(ctx context.Context, config *envconf.Config) (context.Context, error) {
73-
log.Println("Applying manifests.")
73+
log.Println("[INFO] Applying manifests.")
7474
err := fwext.ApplyManifests(config.Client().RESTConfig(), manifestsList...)
7575
if err != nil {
76-
return ctx, fmt.Errorf("failed to apply manifests: %w", err)
76+
return ctx, fmt.Errorf("[ERROR] Failed to apply manifests: %w", err)
7777
}
78-
log.Println("Successfully applied manifests.")
78+
log.Println("[INFO] Successfully applied manifests.")
7979
return ctx, nil
8080
},
8181
common.DeployDaemonSet("nvidia-device-plugin-daemonset", "kube-system"),
@@ -95,20 +95,19 @@ func TestMain(m *testing.M) {
9595

9696
testenv.Finish(
9797
func(ctx context.Context, config *envconf.Config) (context.Context, error) {
98-
log.Println("Deleting NVIDIA device plugin, DCGM Exporter and CloudWatch Agent manifests.")
98+
log.Println("[INFO] Deleting manifests.")
9999
slices.Reverse(manifestsList)
100100
err := fwext.DeleteManifests(config.Client().RESTConfig(), manifestsList...)
101101
if err != nil {
102-
return ctx, fmt.Errorf("failed to delete manifests: %w", err)
102+
return ctx, fmt.Errorf("[ERROR] failed to delete manifests: %w", err)
103103
}
104-
log.Println("Successfully deleted NVIDIA device plugin, DCGM Exporter and CloudWatch Agent manifests.")
104+
log.Println("[INFO] Successfully deleted manifests.")
105105
return ctx, nil
106106
},
107107
)
108108

109-
log.Println("Starting tests...")
110109
exitCode := testenv.Run(m)
111-
log.Printf("Tests finished with exit code %d", exitCode)
110+
log.Printf("[INFO] Tests finished with exit code %d", exitCode)
112111
os.Exit(exitCode)
113112
}
114113

0 commit comments

Comments
 (0)