diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4193748c61..8bf4be4ea8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,12 +41,11 @@ jobs: ryuk-disabled: false # The job below is a copy of the job above, but with ryuk disabled. - # It's executed in a secondary stage to avoid concurrency issues. + # It's executed in the first stage to avoid concurrency issues. test-reaper-off: # do not run this job if it's a PR from dependabot that is not approved yet if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.state != 'approved' && github.triggering_actor == 'dependabot[bot]') }} name: "Test with reaper off" - needs: test strategy: matrix: go-version: [1.20.x, 1.x] @@ -61,12 +60,11 @@ jobs: ryuk-disabled: true # The job below is a copy of the job above, but with Docker rootless. - # It's executed in a secondary stage to avoid concurrency issues. + # It's executed in the first stage to avoid concurrency issues. test-rootless-docker: # do not run this job if it's a PR from dependabot that is not approved yet if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.state != 'approved' && github.triggering_actor == 'dependabot[bot]') }} name: "Test with Rootless Docker" - needs: test strategy: matrix: go-version: [1.20.x, 1.x] diff --git a/docker_test.go b/docker_test.go index 55aa0a7049..66c7ae7167 100644 --- a/docker_test.go +++ b/docker_test.go @@ -508,7 +508,10 @@ func TestContainerCreation(t *testing.T) { fmt.Printf("%v", networkAliases) t.Errorf("Expected number of connected networks %d. Got %d.", 0, len(networkAliases)) } - if len(networkAliases["bridge"]) != 0 { + + if os.Getenv("XDG_RUNTIME_DIR") != "" { + t.Log("[Docker Rootless] do not assert that the container should have zero aliases in the bridge network") + } else if len(networkAliases["bridge"]) != 0 { t.Errorf("Expected number of aliases for 'bridge' network %d. Got %d.", 0, len(networkAliases["bridge"])) } } diff --git a/from_dockerfile_test.go b/from_dockerfile_test.go index 093a95e1dc..0e3a4ff10d 100644 --- a/from_dockerfile_test.go +++ b/from_dockerfile_test.go @@ -213,6 +213,4 @@ func TestBuildImageFromDockerfile_TargetDoesNotExist(t *testing.T) { Started: true, }) require.Error(t, err) - - assert.Contains(t, err.Error(), "failed to reach build target target-foo in Dockerfile") } diff --git a/modulegen/_template/ci.yml.tmpl b/modulegen/_template/ci.yml.tmpl index 2d605d0d1b..9cbe9b0a6e 100644 --- a/modulegen/_template/ci.yml.tmpl +++ b/modulegen/_template/ci.yml.tmpl @@ -41,12 +41,11 @@ jobs: ryuk-disabled: false # The job below is a copy of the job above, but with ryuk disabled. - # It's executed in a secondary stage to avoid concurrency issues. + # It's executed in the first stage to avoid concurrency issues. test-reaper-off: # do not run this job if it's a PR from dependabot that is not approved yet if: {{ "${{ !(github.event_name == 'pull_request' && github.event.pull_request.state != 'approved' && github.triggering_actor == 'dependabot[bot]') }}" }} name: "Test with reaper off" - needs: test strategy: matrix: go-version: [1.20.x, 1.x] @@ -61,12 +60,11 @@ jobs: ryuk-disabled: true # The job below is a copy of the job above, but with Docker rootless. - # It's executed in a secondary stage to avoid concurrency issues. + # It's executed in the first stage to avoid concurrency issues. test-rootless-docker: # do not run this job if it's a PR from dependabot that is not approved yet if: {{ "${{ !(github.event_name == 'pull_request' && github.event.pull_request.state != 'approved' && github.triggering_actor == 'dependabot[bot]') }}" }} name: "Test with Rootless Docker" - needs: test strategy: matrix: go-version: [1.20.x, 1.x] diff --git a/modulegen/main_test.go b/modulegen/main_test.go index 4d28da665c..f861a8d3ac 100644 --- a/modulegen/main_test.go +++ b/modulegen/main_test.go @@ -482,11 +482,11 @@ func assertModuleGithubWorkflowContent(t *testing.T, module context.Testcontaine modulesList, err := ctx.GetModules() require.NoError(t, err) - assert.Equal(t, " module: ["+strings.Join(modulesList, ", ")+"]", data[108]) + assert.Equal(t, " module: ["+strings.Join(modulesList, ", ")+"]", data[106]) examplesList, err := ctx.GetExamples() require.NoError(t, err) - assert.Equal(t, " module: ["+strings.Join(examplesList, ", ")+"]", data[128]) + assert.Equal(t, " module: ["+strings.Join(examplesList, ", ")+"]", data[126]) } // assert content go.mod