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
aa333208
Unverified
Commit
aa333208
authored
Nov 02, 2021
by
Derek Nola
Committed by
GitHub
Nov 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update k3s CI to run all integration tests (#4358)
* Update k3s integration CI so all tests run * Add check for ipv6 to skip test in Github CI Signed-off-by:
dereknola
<
derek.nola@suse.com
>
parent
94c1b988
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
integration.yaml
.github/workflows/integration.yaml
+2
-0
dualstack_int_test.go
tests/integration/dualstack/dualstack_int_test.go
+5
-2
cmd.go
tests/util/cmd.go
+1
-1
No files found.
.github/workflows/integration.yaml
View file @
aa333208
...
@@ -52,6 +52,8 @@ jobs:
...
@@ -52,6 +52,8 @@ jobs:
chmod +x ./dist/artifacts/k3s
chmod +x ./dist/artifacts/k3s
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Integration
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Integration
go tool cover -func coverage.out
go tool cover -func coverage.out
# these tests do not relate to coverage and must be run separately
go test ./tests/integration/... -run Integration
-
name
:
On Failure, Launch Debug Session
-
name
:
On Failure, Launch Debug Session
if
:
${{ failure() }}
if
:
${{ failure() }}
uses
:
mxschmitt/action-tmate@v3
uses
:
mxschmitt/action-tmate@v3
...
...
tests/integration/dualstack/dualstack_int_test.go
View file @
aa333208
package
integration
package
integration
import
(
import
(
"os"
"strings"
"strings"
"testing"
"testing"
...
@@ -18,7 +19,7 @@ var dualStackServerArgs = []string{
...
@@ -18,7 +19,7 @@ var dualStackServerArgs = []string{
"--disable-network-policy"
,
"--disable-network-policy"
,
}
}
var
_
=
BeforeSuite
(
func
()
{
var
_
=
BeforeSuite
(
func
()
{
if
!
testutil
.
IsExistingServer
()
{
if
!
testutil
.
IsExistingServer
()
&&
os
.
Getenv
(
"CI"
)
!=
""
{
var
err
error
var
err
error
dualStackServer
,
err
=
testutil
.
K3sStartServer
(
dualStackServerArgs
...
)
dualStackServer
,
err
=
testutil
.
K3sStartServer
(
dualStackServerArgs
...
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
())
Expect
(
err
)
.
ToNot
(
HaveOccurred
())
...
@@ -29,6 +30,8 @@ var _ = Describe("dual stack", func() {
...
@@ -29,6 +30,8 @@ var _ = Describe("dual stack", func() {
BeforeEach
(
func
()
{
BeforeEach
(
func
()
{
if
testutil
.
IsExistingServer
()
&&
!
testutil
.
ServerArgsPresent
(
dualStackServerArgs
)
{
if
testutil
.
IsExistingServer
()
&&
!
testutil
.
ServerArgsPresent
(
dualStackServerArgs
)
{
Skip
(
"Test needs k3s server with: "
+
strings
.
Join
(
dualStackServerArgs
,
" "
))
Skip
(
"Test needs k3s server with: "
+
strings
.
Join
(
dualStackServerArgs
,
" "
))
}
else
if
os
.
Getenv
(
"CI"
)
==
"true"
{
Skip
(
"Github environment does not support IPv6"
)
}
}
})
})
When
(
"a ipv4 and ipv6 cidr is present"
,
func
()
{
When
(
"a ipv4 and ipv6 cidr is present"
,
func
()
{
...
@@ -48,7 +51,7 @@ var _ = Describe("dual stack", func() {
...
@@ -48,7 +51,7 @@ var _ = Describe("dual stack", func() {
})
})
var
_
=
AfterSuite
(
func
()
{
var
_
=
AfterSuite
(
func
()
{
if
!
testutil
.
IsExistingServer
()
{
if
!
testutil
.
IsExistingServer
()
&&
os
.
Getenv
(
"CI"
)
!=
""
{
Expect
(
testutil
.
K3sKillServer
(
dualStackServer
))
.
To
(
Succeed
())
Expect
(
testutil
.
K3sKillServer
(
dualStackServer
))
.
To
(
Succeed
())
}
}
})
})
...
...
tests/util/cmd.go
View file @
aa333208
...
@@ -172,7 +172,7 @@ func K3sKillServer(server *K3sServer) error {
...
@@ -172,7 +172,7 @@ func K3sKillServer(server *K3sServer) error {
return
err
return
err
}
}
if
!
flock
.
CheckLock
(
lockFile
)
{
if
!
flock
.
CheckLock
(
lockFile
)
{
return
os
.
Remove
(
lockFile
)
return
os
.
Remove
All
(
lockFile
)
}
}
return
nil
return
nil
}
}
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