From 433cbd52543dccdad9806b8d44fd5d054ed559f1 Mon Sep 17 00:00:00 2001 From: baude Date: Sat, 28 Jul 2018 11:11:31 -0500 Subject: Show duration for each ginkgo test and test speed improvements Because our tests are getting so long, we want to be able to audit which tests are taking the longest to complete. This may indicate a bad test, bad CI, bad code, etc and therefore should be auditable. Also, make speed improvements to tests by making sure we only unpack caches images that actually get used. Signed-off-by: baude Closes: #1178 Approved by: mheon --- test/e2e/load_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/e2e/load_test.go') diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go index d39f75927..fa74c45b6 100644 --- a/test/e2e/load_test.go +++ b/test/e2e/load_test.go @@ -1,6 +1,7 @@ package integration import ( + "fmt" "os" "path/filepath" @@ -26,6 +27,9 @@ var _ = Describe("Podman load", func() { AfterEach(func() { podmanTest.Cleanup() + f := CurrentGinkgoTestDescription() + timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds()) + GinkgoWriter.Write([]byte(timedResult)) }) It("podman load input flag", func() { @@ -164,11 +168,9 @@ var _ = Describe("Podman load", func() { It("podman load localhost repo from scratch", func() { outfile := filepath.Join(podmanTest.TempDir, "load_test.tar.gz") - setup := podmanTest.Podman([]string{"pull", fedoraMinimal}) - setup.WaitWithDefaultTimeout() - Expect(setup.ExitCode()).To(Equal(0)) + podmanTest.RestoreArtifact(fedoraMinimal) - setup = podmanTest.Podman([]string{"tag", "fedora-minimal", "hello:world"}) + setup := podmanTest.Podman([]string{"tag", "fedora-minimal", "hello:world"}) setup.WaitWithDefaultTimeout() Expect(setup.ExitCode()).To(Equal(0)) @@ -192,11 +194,9 @@ var _ = Describe("Podman load", func() { It("podman load localhost repo from dir", func() { outfile := filepath.Join(podmanTest.TempDir, "load") - setup := podmanTest.Podman([]string{"pull", fedoraMinimal}) - setup.WaitWithDefaultTimeout() - Expect(setup.ExitCode()).To(Equal(0)) + podmanTest.RestoreArtifact(fedoraMinimal) - setup = podmanTest.Podman([]string{"tag", "fedora-minimal", "hello:world"}) + setup := podmanTest.Podman([]string{"tag", "fedora-minimal", "hello:world"}) setup.WaitWithDefaultTimeout() Expect(setup.ExitCode()).To(Equal(0)) -- cgit v1.2.3-54-g00ecf