Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7a91f6eb
Commit
7a91f6eb
authored
Jan 22, 2025
by
Derek Nola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assign GOCOVERDIR in docker tests
Signed-off-by:
Derek Nola
<
derek.nola@suse.com
>
parent
f4062557
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
test-helpers.go
tests/docker/test-helpers.go
+9
-2
No files found.
tests/docker/test-helpers.go
View file @
7a91f6eb
...
@@ -150,6 +150,7 @@ func (config *TestConfig) ProvisionServers(numOfServers int) error {
...
@@ -150,6 +150,7 @@ func (config *TestConfig) ProvisionServers(numOfServers int) error {
"--memory"
,
"2048m"
,
"--memory"
,
"2048m"
,
"-e"
,
fmt
.
Sprintf
(
"K3S_TOKEN=%s"
,
config
.
Token
),
"-e"
,
fmt
.
Sprintf
(
"K3S_TOKEN=%s"
,
config
.
Token
),
"-e"
,
"K3S_DEBUG=true"
,
"-e"
,
"K3S_DEBUG=true"
,
"-e"
,
"GOCOVERDIR=/tmp/k3s-cov"
,
"-v"
,
"/sys/fs/bpf:/sys/fs/bpf"
,
"-v"
,
"/sys/fs/bpf:/sys/fs/bpf"
,
"-v"
,
"/lib/modules:/lib/modules"
,
"-v"
,
"/lib/modules:/lib/modules"
,
"-v"
,
"/var/run/docker.sock:/var/run/docker.sock"
,
"-v"
,
"/var/run/docker.sock:/var/run/docker.sock"
,
...
@@ -162,10 +163,14 @@ func (config *TestConfig) ProvisionServers(numOfServers int) error {
...
@@ -162,10 +163,14 @@ func (config *TestConfig) ProvisionServers(numOfServers int) error {
return
fmt
.
Errorf
(
"failed to start systemd container: %s: %v"
,
out
,
err
)
return
fmt
.
Errorf
(
"failed to start systemd container: %s: %v"
,
out
,
err
)
}
}
time
.
Sleep
(
5
*
time
.
Second
)
time
.
Sleep
(
5
*
time
.
Second
)
cmd
:=
"mkdir -p /tmp/k3s-cov"
if
out
,
err
:=
newServer
.
RunCmdOnNode
(
cmd
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to create coverage directory: %s: %v"
,
out
,
err
)
}
// The pipe requires that we use sh -c with "" to run the command
// The pipe requires that we use sh -c with "" to run the command
sCmd
:
=
fmt
.
Sprintf
(
"/bin/sh -c
\"
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='%s' INSTALL_K3S_SKIP_DOWNLOAD=true sh -
\"
"
,
cmd
=
fmt
.
Sprintf
(
"/bin/sh -c
\"
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='%s' INSTALL_K3S_SKIP_DOWNLOAD=true sh -
\"
"
,
joinOrStart
+
" "
+
os
.
Getenv
(
fmt
.
Sprintf
(
"SERVER_%d_ARGS"
,
i
)))
joinOrStart
+
" "
+
os
.
Getenv
(
fmt
.
Sprintf
(
"SERVER_%d_ARGS"
,
i
)))
if
out
,
err
:=
newServer
.
RunCmdOnNode
(
sC
md
);
err
!=
nil
{
if
out
,
err
:=
newServer
.
RunCmdOnNode
(
c
md
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to start server: %s: %v"
,
out
,
err
)
return
fmt
.
Errorf
(
"failed to start server: %s: %v"
,
out
,
err
)
}
}
}
else
{
}
else
{
...
@@ -178,6 +183,7 @@ func (config *TestConfig) ProvisionServers(numOfServers int) error {
...
@@ -178,6 +183,7 @@ func (config *TestConfig) ProvisionServers(numOfServers int) error {
"-p"
,
"6443"
,
"-p"
,
"6443"
,
"-e"
,
fmt
.
Sprintf
(
"K3S_TOKEN=%s"
,
config
.
Token
),
"-e"
,
fmt
.
Sprintf
(
"K3S_TOKEN=%s"
,
config
.
Token
),
"-e"
,
"K3S_DEBUG=true"
,
"-e"
,
"K3S_DEBUG=true"
,
"-e"
,
"GOCOVERDIR=/tmp/"
,
os
.
Getenv
(
"SERVER_DOCKER_ARGS"
),
os
.
Getenv
(
"SERVER_DOCKER_ARGS"
),
os
.
Getenv
(
fmt
.
Sprintf
(
"SERVER_%d_DOCKER_ARGS"
,
i
)),
os
.
Getenv
(
fmt
.
Sprintf
(
"SERVER_%d_DOCKER_ARGS"
,
i
)),
os
.
Getenv
(
"REGISTRY_CLUSTER_ARGS"
),
os
.
Getenv
(
"REGISTRY_CLUSTER_ARGS"
),
...
@@ -266,6 +272,7 @@ func (config *TestConfig) ProvisionAgents(numOfAgents int) error {
...
@@ -266,6 +272,7 @@ func (config *TestConfig) ProvisionAgents(numOfAgents int) error {
"--privileged"
,
"--privileged"
,
"-e"
,
fmt
.
Sprintf
(
"K3S_TOKEN=%s"
,
config
.
Token
),
"-e"
,
fmt
.
Sprintf
(
"K3S_TOKEN=%s"
,
config
.
Token
),
"-e"
,
fmt
.
Sprintf
(
"K3S_URL=%s"
,
k3sURL
),
"-e"
,
fmt
.
Sprintf
(
"K3S_URL=%s"
,
k3sURL
),
"-e"
,
"GOCOVERDIR=/tmp/"
,
os
.
Getenv
(
"AGENT_DOCKER_ARGS"
),
os
.
Getenv
(
"AGENT_DOCKER_ARGS"
),
os
.
Getenv
(
fmt
.
Sprintf
(
"AGENT_%d_DOCKER_ARGS"
,
i
)),
os
.
Getenv
(
fmt
.
Sprintf
(
"AGENT_%d_DOCKER_ARGS"
,
i
)),
os
.
Getenv
(
"REGISTRY_CLUSTER_ARGS"
),
os
.
Getenv
(
"REGISTRY_CLUSTER_ARGS"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment