Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aattuluri committed Sep 30, 2024
1 parent f9d8c5a commit e2a009a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion admiral/pkg/controller/admiral/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func TestJobController_Added(t *testing.T) {
Cache: &cache,
}
job := getJob("job-ns", map[string]string{"sidecar.istio.io/inject": "true", "admiral.io/env": "dev"}, map[string]string{"identity": "job", "istio-injected": "true"})
expectedJob := getK8sObjectFromJob(job)
expectedJob.Status = common.ProcessingInProgress
jobWithBadLabels := getJob("jobWithBadLabels-ns", map[string]string{"admiral.io/env": "dev"}, map[string]string{"identity": "jobWithBadLabels", "random-label": "true"})
jobWithIgnoreLabels := getJob("jobWithIgnoreLabels-ns", map[string]string{"sidecar.istio.io/inject": "true", "admiral.io/env": "dev"}, map[string]string{"identity": "jobWithIgnoreLabels", "istio-injected": "true", "admiral-ignore": "true"})
jobWithIgnoreAnnotations := getJob("jobWithIgnoreAnnotations-ns", map[string]string{"admiral.io/ignore": "true"}, map[string]string{"identity": "jobWithIgnoreAnnotations"})
Expand All @@ -73,7 +75,7 @@ func TestJobController_Added(t *testing.T) {
{
name: "Expects job to be added to the cache when the correct label is present",
job: job,
expectedJob: getK8sObjectFromJob(job),
expectedJob: expectedJob,
id: "job",
expectedCacheContains: true,
},
Expand Down
4 changes: 3 additions & 1 deletion admiral/pkg/controller/admiral/monovertex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func TestMonoVertexController_Added(t *testing.T) {
Cache: &cache,
}
monomonoVertex := getMonoVertex("monomonoVertex-ns", map[string]string{"sidecar.istio.io/inject": "true", "admiral.io/env": "dev"}, map[string]string{"identity": "monomonoVertex", "istio-injected": "true"})
expectedMonoVertex := getK8sObjectFromMonoVertex(monomonoVertex)
expectedMonoVertex.Status = common.ProcessingInProgress
monomonoVertexWithBadLabels := getMonoVertex("monomonoVertexWithBadLabels-ns", map[string]string{"admiral.io/env": "dev"}, map[string]string{"identity": "monomonoVertexWithBadLabels", "random-label": "true"})
monomonoVertexWithIgnoreLabels := getMonoVertex("monomonoVertexWithIgnoreLabels-ns", map[string]string{"sidecar.istio.io/inject": "true", "admiral.io/env": "dev"}, map[string]string{"identity": "monomonoVertexWithIgnoreLabels", "istio-injected": "true", "admiral-ignore": "true"})
monomonoVertexWithIgnoreAnnotations := getMonoVertex("monomonoVertexWithIgnoreAnnotations-ns", map[string]string{"admiral.io/ignore": "true"}, map[string]string{"identity": "monomonoVertexWithIgnoreAnnotations"})
Expand All @@ -70,7 +72,7 @@ func TestMonoVertexController_Added(t *testing.T) {
{
name: "Expects monomonoVertex to be added to the cache when the correct label is present",
monomonoVertex: monomonoVertex,
expectedMonoVertex: getK8sObjectFromMonoVertex(monomonoVertex),
expectedMonoVertex: expectedMonoVertex,
id: "monomonoVertex",
expectedCacheContains: true,
},
Expand Down
4 changes: 3 additions & 1 deletion admiral/pkg/controller/admiral/vertex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func TestVertexController_Added(t *testing.T) {
Cache: &cache,
}
vertex := getVertex("vertex-ns", map[string]string{"sidecar.istio.io/inject": "true", "admiral.io/env": "dev"}, map[string]string{"identity": "vertex", "istio-injected": "true"})
expectedVertex := getK8sObjectFromVertex(vertex)
expectedVertex.Status = common.ProcessingInProgress
vertexWithBadLabels := getVertex("vertexWithBadLabels-ns", map[string]string{"admiral.io/env": "dev"}, map[string]string{"identity": "vertexWithBadLabels", "random-label": "true"})
vertexWithIgnoreLabels := getVertex("vertexWithIgnoreLabels-ns", map[string]string{"sidecar.istio.io/inject": "true", "admiral.io/env": "dev"}, map[string]string{"identity": "vertexWithIgnoreLabels", "istio-injected": "true", "admiral-ignore": "true"})
vertexWithIgnoreAnnotations := getVertex("vertexWithIgnoreAnnotations-ns", map[string]string{"admiral.io/ignore": "true"}, map[string]string{"identity": "vertexWithIgnoreAnnotations"})
Expand All @@ -70,7 +72,7 @@ func TestVertexController_Added(t *testing.T) {
{
name: "Expects vertex to be added to the cache when the correct label is present",
vertex: vertex,
expectedVertex: getK8sObjectFromVertex(vertex),
expectedVertex: expectedVertex,
id: "vertex",
expectedCacheContains: true,
},
Expand Down
8 changes: 4 additions & 4 deletions install/sample/sample_dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: admiral.io/v1alpha1
kind: Dependency
metadata:
name: dependency
name: dependency-webapp
namespace: admiral
spec:
source: webapp
Expand All @@ -29,7 +29,7 @@ spec:
apiVersion: admiral.io/v1alpha1
kind: Dependency
metadata:
name: dependency
name: dependency-greeeting
namespace: admiral
spec:
source: greeting
Expand All @@ -41,7 +41,7 @@ spec:
apiVersion: admiral.io/v1alpha1
kind: Dependency
metadata:
name: dependency
name: dependency-job
namespace: admiral
spec:
source: job
Expand All @@ -53,7 +53,7 @@ spec:
apiVersion: admiral.io/v1alpha1
kind: Dependency
metadata:
name: dependency
name: dependency-monovertex
namespace: admiral
spec:
source: monovertex
Expand Down
3 changes: 0 additions & 3 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ sleep 10
./test5.sh "webapp" "sample-rollout-bluegreen" "greeting.bluegreen"
./test2.sh "webapp" "sample-rollout-canary" "greeting.canary"

# Test Proxy VirtualService Call
./test7.sh "webapp" "sample" "stage.httpbin.foo"

#cleanup to fee up the pipeline minkube resources
if [[ $IS_LOCAL == "false" ]]; then
kubectl scale --replicas=0 deploy webapp -n sample
Expand Down

0 comments on commit e2a009a

Please sign in to comment.