Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
add e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
hihilla committed Oct 8, 2020
1 parent 959f192 commit f8ce164
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,55 @@ func TestNewAppAllIn(t *testing.T) {
f.checkReadyPods(relName, targetReplicas)
}

func TestRejectModificationToReleaseEnv(t *testing.T) {
if !*runEndToEnd {
t.Skip("skipping end-to-end tests: --e2e is false")
}
t.Parallel()

targetReplicas := 4
ns, err := setupNamespace(t.Name())
if err != nil {
t.Fatalf("could not create namespace %s: %q", t.Name(), err)
}
f := newFixture(ns.GetName(), t)
defer func() {
if *inspectFailed && t.Failed() {
return
}
teardownNamespace(ns.GetName())
}()

newApp := newApplication(ns.GetName(), appName, &allIn)
newApp.Spec.Template.Values = shipper.ChartValues{"replicaCount": targetReplicas}
newApp.Spec.Template.Chart.Name = "test-nginx"
newApp.Spec.Template.Chart.Version = "0.0.1"

_, err = shipperClient.ShipperV1alpha1().Applications(ns.GetName()).Create(newApp)
if err != nil {
t.Fatalf("could not create application %q: %q", appName, err)
}

t.Logf("waiting for a new release for new application %q", appName)
rel := f.waitForRelease(appName, 0)
relName := rel.GetName()
t.Logf("waiting for release %q to complete", relName)
f.waitForComplete(rel.GetName())
t.Logf("checking that release %q has %d pods (strategy step 0 -- finished)", relName, targetReplicas)
f.checkReadyPods(relName, targetReplicas)

rel, err = shipperClient.ShipperV1alpha1().Releases(ns.GetName()).Get(relName, metav1.GetOptions{})
if err != nil {
t.Fatalf("could not get release %q: %q", relName, err)
}
rel.Spec.Environment.Chart.Name = "changed name"
_, err = shipperClient.ShipperV1alpha1().Releases(ns.GetName()).Update(rel)
if err == nil {
t.Fatalf("updated release environment %q: %q", relName, err)
}
t.Logf("successfully failed to update release environment %q", relName)
}

func TestNewAppAllInWithRolloutBlockOverride(t *testing.T) {
if !*runEndToEnd {
t.Skip("skipping end-to-end tests: --e2e is false")
Expand Down

0 comments on commit f8ce164

Please sign in to comment.