Skip to content

Commit

Permalink
tests: Skip virt tests in Github Actions
Browse files Browse the repository at this point in the history
The Github Actions runners have some weird issues with nested virtualization.

Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 16, 2024
1 parent b7441d3 commit d052667
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/acctest/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package acctest

import (
"fmt"
"os"
"strings"
"testing"

Expand Down Expand Up @@ -69,6 +70,10 @@ func PreCheckAPIExtensions(t *testing.T, extensions ...string) {
// PreCheckVirtualization skips the test if the Incus server does not
// support virtualization.
func PreCheckVirtualization(t *testing.T) {
if os.Getenv("GITHUB_ACTIONS") == "true" {
t.Skipf("Test %q skipped. Virtualization tests can't run in Github Actions.", t.Name())
}

p := testProvider()
server, err := p.InstanceServer("", "", "")
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion internal/instance/resource_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,10 @@ func TestAccInstance_fileUploadContent_VM(t *testing.T) {
instanceName := petname.Generate(2, "-")

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
PreCheck: func() {
acctest.PreCheck(t)
acctest.PreCheckVirtualization(t)
},
ProtoV6ProviderFactories: acctest.ProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Expand Down

0 comments on commit d052667

Please sign in to comment.