Skip to content

Commit 1f83428

Browse files
committed
Remove some output from e2e tests as they are too noisy for reference files
1 parent a8d2d84 commit 1f83428

11 files changed

Lines changed: 127 additions & 141 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ __pycache__/
2929
# Temp files
3030
.DS_Store
3131

32-
*.test
3332
tests_e2e/coverage
3433

3534
# Output of the go coverage tool, specifically when used with LiteIDE

core/docker.go

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,12 @@ func (d *DockerClient) ImageExists(ctx context.Context, imageRef string) (bool,
9797
}
9898

9999
func (d *DockerClient) PullImage(ctx context.Context, imageRef string) error {
100-
utils.LogOut.Infof("%sPulling image '%s'\n", utils.LogGhStartGroup, imageRef)
101-
defer utils.LogOut.Infof(utils.LogGhEndGroup)
100+
verbose := !IsTestE2eRunning()
101+
102+
if verbose {
103+
utils.LogOut.Infof("%sPulling image '%s'\n", utils.LogGhStartGroup, imageRef)
104+
defer utils.LogOut.Infof(utils.LogGhEndGroup)
105+
}
102106

103107
reader, err := d.cli.ImagePull(ctx, imageRef, image.PullOptions{})
104108
if err != nil {
@@ -116,11 +120,13 @@ func (d *DockerClient) PullImage(ctx context.Context, imageRef string) error {
116120
return err
117121
}
118122

119-
if status, ok := event["status"].(string); ok {
120-
if progress, ok := event["progress"].(string); ok {
121-
utils.LogOut.Infof(" %s %s\n", status, progress)
122-
} else {
123-
utils.LogOut.Infof(" %s\n", status)
123+
if verbose {
124+
if status, ok := event["status"].(string); ok {
125+
if progress, ok := event["progress"].(string); ok {
126+
utils.LogOut.Infof(" %s %s\n", status, progress)
127+
} else {
128+
utils.LogOut.Infof(" %s\n", status)
129+
}
124130
}
125131
}
126132
}
@@ -129,8 +135,12 @@ func (d *DockerClient) PullImage(ctx context.Context, imageRef string) error {
129135
}
130136

131137
func (d *DockerClient) BuildImage(ctx context.Context, dockerfilePath, contextPath, tag string) error {
132-
utils.LogOut.Infof("%sBuilding image '%s' from %s\n", utils.LogGhStartGroup, tag, dockerfilePath)
133-
defer utils.LogOut.Infof(utils.LogGhEndGroup)
138+
verbose := !IsTestE2eRunning()
139+
140+
if verbose {
141+
utils.LogOut.Infof("%sBuilding image '%s' from %s\n", utils.LogGhStartGroup, tag, dockerfilePath)
142+
defer utils.LogOut.Infof(utils.LogGhEndGroup)
143+
}
134144

135145
// Create a tar archive of the build context
136146
buildContext, err := createBuildContext(contextPath)
@@ -165,8 +175,10 @@ func (d *DockerClient) BuildImage(ctx context.Context, dockerfilePath, contextPa
165175
return err
166176
}
167177

168-
if stream, ok := event["stream"].(string); ok {
169-
utils.LogOut.Infof("%s", stream)
178+
if verbose {
179+
if stream, ok := event["stream"].(string); ok {
180+
utils.LogOut.Infof("%s", stream)
181+
}
170182
}
171183
if errMsg, ok := event["error"].(string); ok {
172184
return fmt.Errorf("build error: %s", errMsg)

tests_e2e/references/reference_docker-alpine.sh_l11 renamed to tests_e2e/references/reference_docker-alpine_linux.sh_l11

Lines changed: 7 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,10 @@ Creating file in mounted volume...
4242
test-content-1234
4343
🟢 Execute 'Docker Run (docker-network)'
4444
PushNodeVisit: docker-network, execute: true
45-
Test 8: Network host mode
46-
Hostname: docker-desktop
45+
Linux
4746
🟢 Execute 'Docker Run (docker-pull-always)'
4847
PushNodeVisit: docker-pull-always, execute: true
49-
##[group]Pulling image 'alpine:latest'
50-
Pulling from library/alpine
51-
Digest: sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
52-
Status: Image is up to date for alpine:latest
53-
##[endgroup]Test 9: Pull always policy
48+
Test 9: Pull always policy
5449
🟢 Execute 'Docker Run (docker-special-chars)'
5550
PushNodeVisit: docker-special-chars, execute: true
5651
Test 10: Special chars test
@@ -59,32 +54,10 @@ Dollar: $HOME
5954
Backtick: `date`
6055
🟢 Execute 'Docker Run (docker-dockerfile-relative)'
6156
PushNodeVisit: docker-dockerfile-relative, execute: true
62-
##[group]Building image 'actrun-docker-[REDACTED]' from [REDACTED]/Dockerfile.test
63-
Step 1/3 : FROM alpine:latest
64-
---> 25109184c71b
65-
Step 2/3 : ENV MY_BUILD_VAR=default_build_value
66-
---> Using cache
67-
---> fde5e8900876
68-
Step 3/3 : WORKDIR [REDACTED]/app
69-
---> Using cache
70-
---> f6d5f9a2f2a5
71-
Successfully built f6d5f9a2f2a5
72-
Successfully tagged actrun-docker-[REDACTED]:latest
73-
##[endgroup]Test 11: Built from local Dockerfile (relative path)
57+
Test 11: Built from local Dockerfile (relative path)
7458
🟢 Execute 'Docker Run (docker-dockerfile-custom)'
7559
PushNodeVisit: docker-dockerfile-custom, execute: true
76-
##[group]Building image 'actrun-docker-[REDACTED]' from [REDACTED]/Dockerfile.test
77-
Step 1/3 : FROM alpine:latest
78-
---> 25109184c71b
79-
Step 2/3 : ENV MY_BUILD_VAR=default_build_value
80-
---> Using cache
81-
---> fde5e8900876
82-
Step 3/3 : WORKDIR [REDACTED]/app
83-
---> Using cache
84-
---> f6d5f9a2f2a5
85-
Successfully built f6d5f9a2f2a5
86-
Successfully tagged actrun-docker-[REDACTED]:latest
87-
##[endgroup]Test 12: Dockerfile with env and workdir
60+
Test 12: Dockerfile with env and workdir
8861
MY_BUILD_VAR=from_dockerfile_build
8962
Working dir: [REDACTED]/opt
9063
🟢 Execute 'Docker Run (docker-volume-readonly)'
@@ -109,36 +82,15 @@ banana
10982
🟢 Execute 'Docker Run (docker-network-none)'
11083
PushNodeVisit: docker-network-none, execute: true
11184
Test 16: Network none (isolated)
112-
1
85+
Linux
11386
🟢 Execute 'Docker Run (docker-env-special)'
11487
PushNodeVisit: docker-env-special, execute: true
11588
Test 17: Env vars with spaces/special chars
11689
SPACE_VAR=hello world with spaces
11790
SPECIAL_VAR=a=b&c=d!@#
11891
🟢 Execute 'Docker Run (docker-default-cmd)'
11992
PushNodeVisit: docker-default-cmd, execute: true
120-
121-
Hello from Docker!
122-
This message shows that your installation appears to be working correctly.
123-
124-
To generate this message, Docker took the following steps:
125-
1. The Docker client contacted the Docker daemon.
126-
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
127-
(amd64)
128-
3. The Docker daemon created a new container from that image which runs the
129-
executable that produces the output you are currently reading.
130-
4. The Docker daemon streamed that output to the Docker client, which sent it
131-
to your terminal.
132-
133-
To try something more ambitious, you can run an Ubuntu container with:
134-
$ docker run -it ubuntu bash
135-
136-
Share images, automate workflows, and more with a free Docker ID:
137-
https:[REDACTED]/
138-
139-
For more examples and ideas, visit:
140-
https:[REDACTED]/
141-
93+
Hello World
14294
🟢 Execute 'Docker Run (docker-exit-nonzero)'
14395
PushNodeVisit: docker-exit-nonzero, execute: true
14496
Test 19: Non-zero exit code
@@ -157,15 +109,4 @@ Iteration 5
157109
PushNodeVisit: docker-dockerfile-absolute, execute: true
158110
PushNodeVisit: core-filepath-join-v1-pink-hippopotamus-fig, execute: false
159111
PushNodeVisit: core-filepath-location-v1-date-turquoise-teal, execute: false
160-
##[group]Building image 'actrun-docker-[REDACTED]' from [REDACTED]/Dockerfile.test
161-
Step 1/3 : FROM alpine:latest
162-
---> 25109184c71b
163-
Step 2/3 : ENV MY_BUILD_VAR=default_build_value
164-
---> Using cache
165-
---> fde5e8900876
166-
Step 3/3 : WORKDIR [REDACTED]/app
167-
---> Using cache
168-
---> f6d5f9a2f2a5
169-
Successfully built f6d5f9a2f2a5
170-
Successfully tagged actrun-docker-[REDACTED]:latest
171-
##[endgroup]Test 21: Absolute path Dockerfile
112+
Test 21: Absolute path Dockerfile

tests_e2e/references/reference_docker-hello-world.sh_l8

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
build hasn't expired yet
2+
looking for value: 'env_file'
3+
no value (is optional) found for: 'env_file'
4+
looking for value: 'config_file'
5+
no value (is optional) found for: 'config_file'
6+
looking for value: 'concurrency'
7+
no value (is optional) found for: 'concurrency'
8+
looking for value: 'graph_file'
9+
found value in: 'env (shell)'
10+
evaluated to: 'docker-hello-world.act'
11+
looking for value: 'session_token'
12+
no value (is optional) found for: 'session_token'
13+
looking for value: 'create_debug_session'
14+
found value in flags
15+
evaluated to: 'false'
16+
PushNodeVisit: start, execute: true
17+
🟢 Execute 'Docker Run (docker-hello-world)'
18+
PushNodeVisit: docker-hello-world, execute: true
19+
Hello World

tests_e2e/scripts/Dockerfile.e2e

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM alpine:latest
2+
RUN echo "Built from local Dockerfile!"
3+
CMD ["echo", "Default CMD from Dockerfile"]

tests_e2e/scripts/docker-alpine.act

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ nodes:
130130
args:
131131
- '-c'
132132
- |
133-
echo "Test 8: Network host mode"
134-
echo "Hostname: $(hostname)"
133+
uname -s
135134
entrypoint:
136135
- /bin/sh
137136
network: host
@@ -175,7 +174,7 @@ nodes:
175174
x: 5330
176175
y: 1480
177176
inputs:
178-
image: Dockerfile.test
177+
image: Dockerfile.e2e
179178
args:
180179
- '-c'
181180
- echo "Test 11: Built from local Dockerfile (relative path)"
@@ -188,7 +187,7 @@ nodes:
188187
x: 5830
189188
y: 1320
190189
inputs:
191-
image: ./Dockerfile.test
190+
image: ./Dockerfile.e2e
192191
args:
193192
- '-c'
194193
- |
@@ -276,13 +275,9 @@ nodes:
276275
image: docker://alpine:latest
277276
args:
278277
- '-c'
279-
- >
278+
- |
280279
echo "Test 16: Network none (isolated)"
281-
282-
# Check if network interfaces are minimal
283-
284-
ip link show 2>/dev/null | grep -c "^[0-9]" || echo "No ip command,
285-
but that's ok"
280+
uname -s
286281
entrypoint:
287282
- /bin/sh
288283
network: none
@@ -314,7 +309,10 @@ nodes:
314309
x: 8890
315310
y: 480
316311
inputs:
317-
image: docker://hello-world:latest
312+
image: docker://alpine:latest
313+
args:
314+
- echo
315+
- Hello World
318316
pull: missing
319317
docker_socket: true
320318
- id: docker-exit-nonzero
@@ -391,7 +389,7 @@ nodes:
391389
y: 30
392390
inputs:
393391
segments[0]: null
394-
segments[1]: Dockerfile.test
392+
segments[1]: Dockerfile.e2e
395393
connections:
396394
- src:
397395
node: core-filepath-location-v1-date-turquoise-teal
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ echo "Test Docker-Run Alpine Node"
22

33
TEST_NAME=docker-alpine
44
GRAPH_FILE="${ACT_GRAPH_FILES_DIR}${PATH_SEPARATOR}${TEST_NAME}.act"
5-
DOCKERFILE="${ACT_GRAPH_FILES_DIR}${PATH_SEPARATOR}Dockerfile.test"
5+
DOCKERFILE="${ACT_GRAPH_FILES_DIR}${PATH_SEPARATOR}Dockerfile.e2e"
66
cp $GRAPH_FILE $TEST_NAME.act
7-
cp $DOCKERFILE Dockerfile.test
7+
cp $DOCKERFILE Dockerfile.e2e
88

99
export ACT_GRAPH_FILE=$TEST_NAME.act
1010

tests_e2e/scripts/docker-hello-world.act

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ nodes:
1111
x: 300
1212
y: 0
1313
inputs:
14-
image: docker://hello-world:latest
14+
image: docker://alpine:latest
15+
args:
16+
- echo
17+
- Hello World
1518
pull: missing
1619
docker_socket: true
1720
connections: []
File renamed without changes.

0 commit comments

Comments
 (0)