Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: skip assertions for Docker Rootless #2135

Merged
merged 6 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
}
}
Expand Down
2 changes: 0 additions & 2 deletions from_dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
6 changes: 2 additions & 4 deletions modulegen/_template/ci.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions modulegen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading