fix(e2e): Update revision e2e tests (#696)

Fixes #695
 - Re-order revision tests operations to avoid any race condition that
   may cause.
This commit is contained in:
Navid Shaikh 2020-03-02 14:17:52 +05:30 committed by GitHub
parent b95f40e2fe
commit c1f3eb867b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -45,27 +45,25 @@ func TestRevision(t *testing.T) {
revName := test.findRevision(t, r, "hello") revName := test.findRevision(t, r, "hello")
test.revisionDescribeWithPrintFlags(t, r, revName) test.revisionDescribeWithPrintFlags(t, r, revName)
t.Log("update hello service and increase the count of configuration generation") t.Log("update hello service and increase revision count to 2")
test.serviceUpdate(t, r, "hello", "--env", "TARGET=kn", "--port", "8888") test.serviceUpdate(t, r, "hello", "--env", "TARGET=kn", "--port", "8888")
t.Log("show a list of revisions sorted by the count of configuration generation") t.Log("show a list of revisions sorted by the count of configuration generation")
test.revisionListWithService(t, r, "hello") test.revisionListWithService(t, r, "hello")
t.Log("delete latest revision from hello service and return no error") t.Log("update hello service and increase revision count to 3")
revName = test.findRevision(t, r, "hello")
test.revisionDelete(t, r, revName)
t.Log("delete three revisions with one revision a nonexistent")
// increase count to 2 revisions
test.serviceUpdate(t, r, "hello", "--env", "TARGET=kn", "--port", "8888") test.serviceUpdate(t, r, "hello", "--env", "TARGET=kn", "--port", "8888")
t.Log("delete three revisions with one revision a nonexistent")
existRevision1 := test.findRevisionByGeneration(t, r, "hello", 1) existRevision1 := test.findRevisionByGeneration(t, r, "hello", 1)
existRevision2 := test.findRevisionByGeneration(t, r, "hello", 2) existRevision2 := test.findRevisionByGeneration(t, r, "hello", 2)
nonexistRevision := "hello-nonexist" nonexistRevision := "hello-nonexist"
test.revisionMultipleDelete(t, r, existRevision1, existRevision2, nonexistRevision) test.revisionMultipleDelete(t, r, existRevision1, existRevision2, nonexistRevision)
t.Log("delete latest revision from hello service and return no error")
revName = test.findRevision(t, r, "hello")
test.revisionDelete(t, r, revName)
t.Log("delete hello service and return no error") t.Log("delete hello service and return no error")
test.serviceDelete(t, r, "hello") test.serviceDelete(t, r, "hello")
} }