Skip to content

Commit a8325dc

Browse files
committed
[QE]add performance data gathering for microshift test cases
1 parent fe59013 commit a8325dc

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

test/e2e/features/story_microshift.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ Feature: Microshift test stories
77
And setting config property "persistent-volume-size" to value "20" succeeds
88
And ensuring network mode user
99
And executing single crc setup command succeeds
10+
And get cpu data "Before start"
11+
And get memory data "Before start"
1012
And starting CRC with default bundle succeeds
13+
And get cpu data "After start"
14+
And get memory data "After start"
1115
And ensuring oc command is available
1216
And ensuring microshift cluster is fully operational
1317
And executing "crc status" succeeds
@@ -32,9 +36,13 @@ Feature: Microshift test stories
3236
When executing "oc expose svc httpd-example" succeeds
3337
Then stdout should contain "httpd-example exposed"
3438
When with up to "20" retries with wait period of "5s" http response from "http://httpd-example-testproj.apps.crc.testing" has status code "200"
39+
And get cpu data "After deployment"
40+
And get memory data "After deployment"
3541
Then executing "curl -s http://httpd-example-testproj.apps.crc.testing" succeeds
3642
And stdout should contain "Hello CRC!"
3743
When executing "crc stop" succeeds
44+
And get cpu data "After stop"
45+
And get memory data "After stop"
3846
And starting CRC with default bundle succeeds
3947
And checking that CRC is running
4048
And with up to "4" retries with wait period of "1m" http response from "http://httpd-example-testproj.apps.crc.testing" has status code "200"

test/integration/podman_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"os"
55
"path/filepath"
66
"runtime"
7+
"time"
78

89
"github.com/crc-org/crc/v2/test/extended/crc/cmd"
910
"github.com/crc-org/crc/v2/test/extended/util"
@@ -12,7 +13,7 @@ import (
1213
)
1314

1415
var _ = Describe("podman-remote", Serial, Ordered, Label("microshift-preset"), func() {
15-
16+
filename := "time-consume.txt"
1617
// runs 1x after all the It blocks (specs) inside this Describe node
1718
AfterAll(func() {
1819

@@ -39,9 +40,12 @@ var _ = Describe("podman-remote", Serial, Ordered, Label("microshift-preset"), f
3940

4041
It("start CRC", func() {
4142
// default values: "--memory", "10752", "--cpus", "4", "disk-size", "31"
42-
Expect(
43-
crcSuccess("start", "-p", pullSecretPath)).
44-
To(ContainSubstring("Started the MicroShift cluster"))
43+
start := time.Now()
44+
message := crcSuccess("start", "-p", pullSecretPath)
45+
duration := time.Since(start)
46+
Expect(message).To(ContainSubstring("Started the MicroShift cluster"))
47+
data := "crc start: " + duration.String() + "\n"
48+
writeDataToFile(filename, data)
4549
})
4650

4751
It("podman-env", func() {

0 commit comments

Comments
 (0)