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

Misc CI improvements #3001

Merged
merged 10 commits into from
May 27, 2024
Merged

Misc CI improvements #3001

merged 10 commits into from
May 27, 2024

Conversation

stephenfin
Copy link
Contributor

@stephenfin stephenfin commented Mar 20, 2024

This started out as a series to add a go vet task to our CI jobs but transformed into a much larger PR to fix complaints I had with out current CI process 🙂.

The main change here is modify our tests so that we do not need so many wrappers around go test. This means making consistent use of conditional compilation directives to skip integration tests when running e.g. go test ./... and adding helper utilities to skip tests that rely on non-standard extensions or deployment configuration. The end result is that it should be possible to mostly use go test without wrappers going forward (though the wrappers are kept for now).

Please look at the individual commits for my rationale behind each change.

@github-actions github-actions bot added the semver:patch No API change label Mar 20, 2024
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@coveralls
Copy link

coveralls commented Mar 20, 2024

Coverage Status

coverage: 78.696%. remained the same
when pulling f2c3732 on stephenfin:ci-improvements
into 571ae75 on gophercloud:master.

internal/acceptance/openstack/baremetal/noauth/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/baremetal/v1/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/baremetal/httpbasic/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/blockstorage/noauth/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/compute/v2/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/container/v1/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/containerinfra/v1/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/db/v1/pkg.go Outdated Show resolved Hide resolved
internal/acceptance/openstack/dns/v2/pkg.go Outdated Show resolved Hide resolved
This has not been used since we migrated to Travis.

Signed-off-by: Stephen Finucane <[email protected]>
...to ensure we set the GOFLAGS correctly.

Signed-off-by: Stephen Finucane <[email protected]>
Well, mostly consistent: the acceptancetest script needs some special
treatment due to DevStack being weird.

Signed-off-by: Stephen Finucane <[email protected]>
I'm guessing this was here to ensure we respected the exit code of the
'go test' invocation. We now do this through the appropriate use of
'set' so we no longer need to use 'exec'.

Signed-off-by: Stephen Finucane <[email protected]>
We now use 'go vet' in CI, which includes import checks. Since we don't
want to *fix* these failures in CI - merely report them - this is a
better choice. Drop 'goimports' in favour of 'gofmt'.

Signed-off-by: Stephen Finucane <[email protected]>
I often see failing "unit tests" only to discover the actual failures
are linter related. Move these linter jobs to a separate workflow to
avoid this confusion going forward.

Signed-off-by: Stephen Finucane <[email protected]>
This is already run as part of the 'unit' workflow.

Signed-off-by: Stephen Finucane <[email protected]>
Now that we skip tests that require optional features or extensions, we
can use standard module discovery rather than a glob of bash to run our
tests.

Signed-off-by: Stephen Finucane <[email protected]>
Signed-off-by: Stephen Finucane <[email protected]>
This isn't necessary since Go 1.16 [1].

[1] https://maelvls.dev/go111module-everywhere/

Signed-off-by: Stephen Finucane <[email protected]>
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels May 23, 2024
@stephenfin stephenfin mentioned this pull request May 23, 2024
Copy link
Contributor

@EmilienM EmilienM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work!

@EmilienM EmilienM merged commit 1405b4d into gophercloud:master May 27, 2024
71 of 72 checks passed
@stephenfin stephenfin deleted the ci-improvements branch May 28, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch No API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants