Skip to content

Commit d052667

Browse files
committed
tests: Skip virt tests in Github Actions
The Github Actions runners have some weird issues with nested virtualization. Signed-off-by: Stéphane Graber <[email protected]>
1 parent b7441d3 commit d052667

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/acctest/checks.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package acctest
22

33
import (
44
"fmt"
5+
"os"
56
"strings"
67
"testing"
78

@@ -69,6 +70,10 @@ func PreCheckAPIExtensions(t *testing.T, extensions ...string) {
6970
// PreCheckVirtualization skips the test if the Incus server does not
7071
// support virtualization.
7172
func PreCheckVirtualization(t *testing.T) {
73+
if os.Getenv("GITHUB_ACTIONS") == "true" {
74+
t.Skipf("Test %q skipped. Virtualization tests can't run in Github Actions.", t.Name())
75+
}
76+
7277
p := testProvider()
7378
server, err := p.InstanceServer("", "", "")
7479
if err != nil {

internal/instance/resource_instance_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,10 @@ func TestAccInstance_fileUploadContent_VM(t *testing.T) {
556556
instanceName := petname.Generate(2, "-")
557557

558558
resource.Test(t, resource.TestCase{
559-
PreCheck: func() { acctest.PreCheck(t) },
559+
PreCheck: func() {
560+
acctest.PreCheck(t)
561+
acctest.PreCheckVirtualization(t)
562+
},
560563
ProtoV6ProviderFactories: acctest.ProtoV6ProviderFactories,
561564
Steps: []resource.TestStep{
562565
{

0 commit comments

Comments
 (0)