|
@@ -167,7 +167,7 @@ func TestExporters(t *testing.T) {
|
|
|
t.Run("allocation exporter", func(t *testing.T) {
|
|
t.Run("allocation exporter", func(t *testing.T) {
|
|
|
allocSource := NewMockAllocationSource()
|
|
allocSource := NewMockAllocationSource()
|
|
|
memStore := storage.NewMemoryStorage()
|
|
memStore := storage.NewMemoryStorage()
|
|
|
- p, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.AllocationPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ p, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.AllocationPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create path formatter: %v", err)
|
|
t.Fatalf("failed to create path formatter: %v", err)
|
|
|
}
|
|
}
|
|
@@ -196,7 +196,7 @@ func TestExporters(t *testing.T) {
|
|
|
t.Run("asset exporter", func(t *testing.T) {
|
|
t.Run("asset exporter", func(t *testing.T) {
|
|
|
assetSource := NewMockAssetSource()
|
|
assetSource := NewMockAssetSource()
|
|
|
memStore := storage.NewMemoryStorage()
|
|
memStore := storage.NewMemoryStorage()
|
|
|
- p, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.AssetsPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ p, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.AssetsPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create path formatter: %v", err)
|
|
t.Fatalf("failed to create path formatter: %v", err)
|
|
|
}
|
|
}
|
|
@@ -225,7 +225,7 @@ func TestExporters(t *testing.T) {
|
|
|
t.Run("network insight exporter", func(t *testing.T) {
|
|
t.Run("network insight exporter", func(t *testing.T) {
|
|
|
netInsightSource := NewMockNetworkInsightSource()
|
|
netInsightSource := NewMockNetworkInsightSource()
|
|
|
memStore := storage.NewMemoryStorage()
|
|
memStore := storage.NewMemoryStorage()
|
|
|
- p, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.NetworkInsightPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ p, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.NetworkInsightPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create path formatter: %v", err)
|
|
t.Fatalf("failed to create path formatter: %v", err)
|
|
|
}
|
|
}
|
|
@@ -290,7 +290,7 @@ func TestExporters(t *testing.T) {
|
|
|
t.Fatalf("expected error creating unknown pipeline exporter, got nil")
|
|
t.Fatalf("expected error creating unknown pipeline exporter, got nil")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Invalid cluster id
|
|
|
|
|
|
|
+ // Invalid cluster name
|
|
|
_, err = NewComputePipelineExporter[opencost.AllocationSet](ComputeExporterConfig{ClusterName: "", Resolution: TestResolution}, memStore)
|
|
_, err = NewComputePipelineExporter[opencost.AllocationSet](ComputeExporterConfig{ClusterName: "", Resolution: TestResolution}, memStore)
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
t.Fatalf("expected error creating allocation pipeline exporter with empty cluster id, got nil")
|
|
t.Fatalf("expected error creating allocation pipeline exporter with empty cluster id, got nil")
|
|
@@ -320,15 +320,15 @@ func TestPipelineExportControllers(t *testing.T) {
|
|
|
time.Sleep(time.Second + (750 * time.Millisecond))
|
|
time.Sleep(time.Second + (750 * time.Millisecond))
|
|
|
exportControllers.Stop()
|
|
exportControllers.Stop()
|
|
|
|
|
|
|
|
- allocPath, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.AllocationPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ allocPath, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.AllocationPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create allocations path formatter: %v", err)
|
|
t.Fatalf("failed to create allocations path formatter: %v", err)
|
|
|
}
|
|
}
|
|
|
- assetPath, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.AssetsPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ assetPath, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.AssetsPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create assets path formatter: %v", err)
|
|
t.Fatalf("failed to create assets path formatter: %v", err)
|
|
|
}
|
|
}
|
|
|
- netPath, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.NetworkInsightPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ netPath, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.NetworkInsightPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create net insights path formatter: %v", err)
|
|
t.Fatalf("failed to create net insights path formatter: %v", err)
|
|
|
}
|
|
}
|
|
@@ -359,15 +359,15 @@ func TestPipelineExportControllers(t *testing.T) {
|
|
|
time.Sleep(time.Second + (750 * time.Millisecond))
|
|
time.Sleep(time.Second + (750 * time.Millisecond))
|
|
|
exportControllers.Stop()
|
|
exportControllers.Stop()
|
|
|
|
|
|
|
|
- allocPath, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.AllocationPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ allocPath, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.AllocationPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create allocations path formatter: %v", err)
|
|
t.Fatalf("failed to create allocations path formatter: %v", err)
|
|
|
}
|
|
}
|
|
|
- assetPath, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.AssetsPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ assetPath, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.AssetsPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create assets path formatter: %v", err)
|
|
t.Fatalf("failed to create assets path formatter: %v", err)
|
|
|
}
|
|
}
|
|
|
- netPath, err := pathing.NewDefaultStoragePathFormatter(TestClusterName, pipelines.NetworkInsightPipelineName, ptr(TestResolution))
|
|
|
|
|
|
|
+ netPath, err := pathing.NewDefaultStoragePathFormatter(TestAppName, TestClusterID, TestClusterName, pipelines.NetworkInsightPipelineName, ptr(TestResolution))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("failed to create net insights path formatter: %v", err)
|
|
t.Fatalf("failed to create net insights path formatter: %v", err)
|
|
|
}
|
|
}
|