Skip to content

Commit 014317a

Browse files
committed
fix: correct jarDir path in cf_metrics_exporter tests
DepDir() returns filepath.Join(depsDir, depsIdx), so the JAR is placed at tmpDepDir/0/cf_metrics_exporter/ not tmpDepDir/cf_metrics_exporter/. The tests were hollow before f4757c8 (the Installer was nil), masking the wrong path. Add the '0' index subdirectory to jarDir in both TestSupplyPlacesJarCorrectly and TestSupplyLogsProps.
1 parent 78bdd0b commit 014317a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/java/frameworks/cf_metrics_exporter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func TestSupplyPlacesJarCorrectly(t *testing.T) {
102102

103103
// Pre-create the expected JAR file
104104
jarName := "cf-metrics-exporter-0.7.1.jar" // adjust if version changes in manifest
105-
jarDir := filepath.Join(tmpDepDir, "cf_metrics_exporter")
105+
jarDir := filepath.Join(tmpDepDir, "0", "cf_metrics_exporter")
106106
if err := os.MkdirAll(jarDir, 0755); err != nil {
107107
t.Fatalf("Failed to create jar dir: %v", err)
108108
}
@@ -151,7 +151,7 @@ func TestSupplyLogsProps(t *testing.T) {
151151

152152
// Pre-create the expected JAR file
153153
jarName := "cf-metrics-exporter-0.7.1.jar"
154-
jarDir := filepath.Join(tmpDepDir, "cf_metrics_exporter")
154+
jarDir := filepath.Join(tmpDepDir, "0", "cf_metrics_exporter")
155155
if err := os.MkdirAll(jarDir, 0755); err != nil {
156156
t.Fatalf("Failed to create jar dir: %v", err)
157157
}

0 commit comments

Comments
 (0)