Skip to content

[v2] CI: improve test assertions - #3930

Merged
mandre merged 3 commits into
gophercloud:v2from
shiftstack:bp-v2-3777
Aug 19, 2026
Merged

mandre merged 3 commits into
gophercloud:v2from
shiftstack:bp-v2-3777

Conversation

@stephenfin

Copy link
Copy Markdown
Contributor

This is a partial backport of #3777, with the last commit skipped due to the large number of merge conflicts. 2 of the 3 remaining commits also have merge conflicts but these are relatively trivial and documented in the commit message.

We want this change mainly due to the addition of the new test assertion helpers, which are relying on in main.

  • Fix assertion argument order: expected first, actual second
  • Fix incorrect field assertions in acceptance tests
  • testhelper: add new test assertion helpers

@github-actions github-actions Bot added edit:networking This PR updates networking code edit:dns This PR updates dns code edit:image This PR updates image code edit:orchestration This PR updates orchestration code edit:db This PR updates db code edit:loadbalancer This PR updates loadbalancer code edit:compute This PR updates compute code edit:keymanager This PR updates keymanager code v2 This PR targets v2 edit:messaging This PR updates messaging code edit:containerinfra This PR updates containerinfra code edit:placement This PR updates placement code edit:objectstorage This PR updates objectstorage code edit:sharedfilesystems This PR updates sharedfilesystems code edit:baremetal This PR updates baremetal code edit:gophercloud This PR updates common Gophercloud code edit:blockstorage This PR updates blockstorage code edit:identity This PR updates identity code edit:container This PR updates container code edit:baremetalintrospection This PR updates baremetalintrospection code edit:testinfra This PR updates testing infrastructure code semver:minor Backwards-compatible change labels Aug 10, 2026
@coveralls

coveralls commented Aug 10, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 63.842% (-0.03%) from 63.871% — shiftstack:bp-v2-3777 into gophercloud:v2

@stephenfin

Copy link
Copy Markdown
Contributor Author

I think needs a backport of #3945

mandre added 3 commits August 17, 2026 17:47
All equality assertion helpers (AssertEquals, CheckEquals, AssertDeepEquals,
CheckDeepEquals, etc.) expect (t, expected, actual) but many call sites had
the arguments swapped, putting the actual value first and the expected
literal second. This causes confusing error messages on test failure.

Conflicts:
    internal/acceptance/openstack/identity/v3/endpoint_test.go
    internal/acceptance/openstack/networking/v2/extensions/security_test.go

NOTE(stephenfin): Conflicts are due to the absence of commits 57d6a12
and c759860, both of which change fields to pointers to allow them to
be unset and neither of which are backportable.
Fix bugs where assertions compared the wrong field or compared a value
to itself, silently passing due to empty string values.
Add AssertTrue, AssertFalse, CheckTrue, CheckFalse for boolean
assertions, and AssertEqualsIgnoreCase, CheckEqualsIgnoreCase for
case-insensitive string comparisons.

Replace all existing uses of AssertEquals and CheckEquals with boolean
literal arguments to use the new helpers instead.

Conflicts:
    internal/acceptance/openstack/loadbalancer/v2/loadbalancer.go

NOTE(stephenfin): Conflicts are due to commits c9703e7 and
832af4f, which change a field to a pointer and rename a field,
respectively. Neither are backportable.
@winiciusallan

Copy link
Copy Markdown
Contributor

I think we need to backport #3765 to V2 so we can run Magnum jobs. Created a manual backport for this #3954

functional-baremetal failure looks unrelated 🤔. I asked on #openstack-ironic if the missing image should be available in the tarball repository, and it looks like tinyipa ram disk type isn't supported anymore. we may need to change to something else like dib. Did this on #3955

@mandre
mandre merged commit 1933dfd into gophercloud:v2 Aug 19, 2026
59 of 61 checks passed
@mandre
mandre deleted the bp-v2-3777 branch August 19, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

edit:baremetal This PR updates baremetal code edit:baremetalintrospection This PR updates baremetalintrospection code edit:blockstorage This PR updates blockstorage code edit:compute This PR updates compute code edit:container This PR updates container code edit:containerinfra This PR updates containerinfra code edit:db This PR updates db code edit:dns This PR updates dns code edit:gophercloud This PR updates common Gophercloud code edit:identity This PR updates identity code edit:image This PR updates image code edit:keymanager This PR updates keymanager code edit:loadbalancer This PR updates loadbalancer code edit:messaging This PR updates messaging code edit:networking This PR updates networking code edit:objectstorage This PR updates objectstorage code edit:orchestration This PR updates orchestration code edit:placement This PR updates placement code edit:sharedfilesystems This PR updates sharedfilesystems code edit:testinfra This PR updates testing infrastructure code semver:minor Backwards-compatible change v2 This PR targets v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants