-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
assert: deprecate CompareType #1566
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dolmen
added
pkg-assert
Change related to package testify/assert
internal/refactor
Refactor internals with no external visible changes
internal/cleanup
Internal change to ease maintenance without external impact
labels
Mar 5, 2024
arjunmahishi
approved these changes
Mar 5, 2024
brackendawson
requested changes
Mar 5, 2024
Similar PR about deprecating a private type that should not have been exposed: #1441. |
brackendawson
approved these changes
Mar 6, 2024
Refactor Test_compareTwoValuesCorrectCompareResult table test to be more explicit: "compareTypes" renamed to "allowedResults".
Refactor compareTwoValues tests to free the 'compareResult' symbol name (for incoming use of this name in next commit).
Rename CompareType to compareResult to make it private. This type is used only in internal functions and is of no use for external users and should never have been made public. CompareType has been introduced by 0b4ff03 and appeared in releases since v1.6.0. Note: strictly speaking, this is a breaking change, but no external user should have ever used assert.CompareType as it made no sense in the assert API. A search on GitHub has revealed no use of it. https://github.com/search?q=assert.CompareType+language%3AGo&type=Repositories&ref=advsearch&l=Go&l=
Reinstate CompareType for full backward compatibility, but mark it as deprecated.
dolmen
force-pushed
the
assert-deprecate-CompareType
branch
from
March 19, 2024 23:47
05f46a6
to
a155d2a
Compare
apricote
pushed a commit
to hetznercloud/fleeting-plugin-hetzner
that referenced
this pull request
Nov 25, 2024
…nercloud/fleeting-plugin-hetzner!175) This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/stretchr/testify](https://github.com/stretchr/testify) | require | minor | `v1.9.0` -> `v1.10.0` | --- ### Release Notes <details> <summary>stretchr/testify (github.com/stretchr/testify)</summary> ### [`v1.10.0`](https://github.com/stretchr/testify/releases/tag/v1.10.0) [Compare Source](stretchr/testify@v1.9.0...v1.10.0) #### What's Changed ##### Functional Changes - Add PanicAssertionFunc by [@​fahimbagar](https://github.com/fahimbagar) in stretchr/testify#1337 - assert: deprecate CompareType by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1566 - assert: make YAML dependency pluggable via build tags by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1579 - assert: new assertion NotElementsMatch by [@​hendrywiranto](https://github.com/hendrywiranto) in stretchr/testify#1600 - mock: in order mock calls by [@​ReyOrtiz](https://github.com/ReyOrtiz) in stretchr/testify#1637 - Add assertion for NotErrorAs by [@​palsivertsen](https://github.com/palsivertsen) in stretchr/testify#1129 - Record Return Arguments of a Call by [@​jayd3e](https://github.com/jayd3e) in stretchr/testify#1636 - assert.EqualExportedValues: accepts everything by [@​redachl](https://github.com/redachl) in stretchr/testify#1586 ##### Fixes - assert: make tHelper a type alias by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1562 - Do not get argument again unnecessarily in Arguments.Error() by [@​TomWright](https://github.com/TomWright) in stretchr/testify#820 - Fix time.Time compare by [@​myxo](https://github.com/myxo) in stretchr/testify#1582 - assert.Regexp: handle \[]byte array properly by [@​kevinburkesegment](https://github.com/kevinburkesegment) in stretchr/testify#1587 - assert: collect.FailNow() should not panic by [@​marshall-lee](https://github.com/marshall-lee) in stretchr/testify#1481 - mock: simplify implementation of FunctionalOptions by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1571 - mock: caller information for unexpected method call by [@​spirin](https://github.com/spirin) in stretchr/testify#1644 - suite: fix test failures by [@​stevenh](https://github.com/stevenh) in stretchr/testify#1421 - Fix issue [#​1662](stretchr/testify#1662) (comparing infs should fail) by [@​ybrustin](https://github.com/ybrustin) in stretchr/testify#1663 - NotSame should fail if args are not pointers [#​1661](stretchr/testify#1661) by [@​sikehish](https://github.com/sikehish) in stretchr/testify#1664 - Increase timeouts in Test_Mock_Called_blocks to reduce flakiness in CI by [@​sikehish](https://github.com/sikehish) in stretchr/testify#1667 - fix: compare functional option names for indirect calls by [@​arjun-1](https://github.com/arjun-1) in stretchr/testify#1626 ##### Documantation, Build & CI - .gitignore: ignore "go test -c" binaries by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1565 - mock: improve doc by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1570 - mock: fix FunctionalOptions docs by [@​snirye](https://github.com/snirye) in stretchr/testify#1433 - README: link out to the excellent testifylint by [@​brackendawson](https://github.com/brackendawson) in stretchr/testify#1568 - assert: fix typo in comment by [@​JohnEndson](https://github.com/JohnEndson) in stretchr/testify#1580 - Correct the EventuallyWithT and EventuallyWithTf example by [@​JonCrowther](https://github.com/JonCrowther) in stretchr/testify#1588 - CI: bump softprops/action-gh-release from 1 to 2 by [@​dependabot](https://github.com/dependabot) in stretchr/testify#1575 - mock: document more alternatives to deprecated AnythingOfTypeArgument by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1569 - assert: Correctly document EqualValues behavior by [@​brackendawson](https://github.com/brackendawson) in stretchr/testify#1593 - fix: grammar in godoc by [@​miparnisari](https://github.com/miparnisari) in stretchr/testify#1607 - .github/workflows: Run tests for Go 1.22 by [@​HaraldNordgren](https://github.com/HaraldNordgren) in stretchr/testify#1629 - Document suite's lack of support for t.Parallel by [@​brackendawson](https://github.com/brackendawson) in stretchr/testify#1645 - assert: fix typos in comments by [@​alexandear](https://github.com/alexandear) in stretchr/testify#1650 - mock: fix doc comment for NotBefore by [@​alexandear](https://github.com/alexandear) in stretchr/testify#1651 - Generate better comments for require package by [@​Neokil](https://github.com/Neokil) in stretchr/testify#1610 - README: replace Testify V2 notice with [@​dolmen](https://github.com/dolmen)'s V2 manifesto by [@​hendrywiranto](https://github.com/hendrywiranto) in stretchr/testify#1518 #### New Contributors - [@​fahimbagar](https://github.com/fahimbagar) made their first contribution in stretchr/testify#1337 - [@​TomWright](https://github.com/TomWright) made their first contribution in stretchr/testify#820 - [@​snirye](https://github.com/snirye) made their first contribution in stretchr/testify#1433 - [@​myxo](https://github.com/myxo) made their first contribution in stretchr/testify#1582 - [@​JohnEndson](https://github.com/JohnEndson) made their first contribution in stretchr/testify#1580 - [@​JonCrowther](https://github.com/JonCrowther) made their first contribution in stretchr/testify#1588 - [@​miparnisari](https://github.com/miparnisari) made their first contribution in stretchr/testify#1607 - [@​marshall-lee](https://github.com/marshall-lee) made their first contribution in stretchr/testify#1481 - [@​spirin](https://github.com/spirin) made their first contribution in stretchr/testify#1644 - [@​ReyOrtiz](https://github.com/ReyOrtiz) made their first contribution in stretchr/testify#1637 - [@​stevenh](https://github.com/stevenh) made their first contribution in stretchr/testify#1421 - [@​jayd3e](https://github.com/jayd3e) made their first contribution in stretchr/testify#1636 - [@​Neokil](https://github.com/Neokil) made their first contribution in stretchr/testify#1610 - [@​redachl](https://github.com/redachl) made their first contribution in stretchr/testify#1586 - [@​ybrustin](https://github.com/ybrustin) made their first contribution in stretchr/testify#1663 - [@​sikehish](https://github.com/sikehish) made their first contribution in stretchr/testify#1664 - [@​arjun-1](https://github.com/arjun-1) made their first contribution in stretchr/testify#1626 **Full Changelog**: stretchr/testify@v1.9.0...v1.10.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yOC4wIiwidXBkYXRlZEluVmVyIjoiMzkuMjguMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
algitbot
pushed a commit
to alpinelinux/build-server-status
that referenced
this pull request
Dec 10, 2024
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/stretchr/testify](https://github.com/stretchr/testify) | require | minor | `v1.9.0` -> `v1.10.0` | --- ### Release Notes <details> <summary>stretchr/testify (github.com/stretchr/testify)</summary> ### [`v1.10.0`](https://github.com/stretchr/testify/releases/tag/v1.10.0) [Compare Source](stretchr/testify@v1.9.0...v1.10.0) #### What's Changed ##### Functional Changes - Add PanicAssertionFunc by [@​fahimbagar](https://github.com/fahimbagar) in stretchr/testify#1337 - assert: deprecate CompareType by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1566 - assert: make YAML dependency pluggable via build tags by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1579 - assert: new assertion NotElementsMatch by [@​hendrywiranto](https://github.com/hendrywiranto) in stretchr/testify#1600 - mock: in order mock calls by [@​ReyOrtiz](https://github.com/ReyOrtiz) in stretchr/testify#1637 - Add assertion for NotErrorAs by [@​palsivertsen](https://github.com/palsivertsen) in stretchr/testify#1129 - Record Return Arguments of a Call by [@​jayd3e](https://github.com/jayd3e) in stretchr/testify#1636 - assert.EqualExportedValues: accepts everything by [@​redachl](https://github.com/redachl) in stretchr/testify#1586 ##### Fixes - assert: make tHelper a type alias by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1562 - Do not get argument again unnecessarily in Arguments.Error() by [@​TomWright](https://github.com/TomWright) in stretchr/testify#820 - Fix time.Time compare by [@​myxo](https://github.com/myxo) in stretchr/testify#1582 - assert.Regexp: handle \[]byte array properly by [@​kevinburkesegment](https://github.com/kevinburkesegment) in stretchr/testify#1587 - assert: collect.FailNow() should not panic by [@​marshall-lee](https://github.com/marshall-lee) in stretchr/testify#1481 - mock: simplify implementation of FunctionalOptions by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1571 - mock: caller information for unexpected method call by [@​spirin](https://github.com/spirin) in stretchr/testify#1644 - suite: fix test failures by [@​stevenh](https://github.com/stevenh) in stretchr/testify#1421 - Fix issue [#​1662](stretchr/testify#1662) (comparing infs should fail) by [@​ybrustin](https://github.com/ybrustin) in stretchr/testify#1663 - NotSame should fail if args are not pointers [#​1661](stretchr/testify#1661) by [@​sikehish](https://github.com/sikehish) in stretchr/testify#1664 - Increase timeouts in Test_Mock_Called_blocks to reduce flakiness in CI by [@​sikehish](https://github.com/sikehish) in stretchr/testify#1667 - fix: compare functional option names for indirect calls by [@​arjun-1](https://github.com/arjun-1) in stretchr/testify#1626 ##### Documantation, Build & CI - .gitignore: ignore "go test -c" binaries by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1565 - mock: improve doc by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1570 - mock: fix FunctionalOptions docs by [@​snirye](https://github.com/snirye) in stretchr/testify#1433 - README: link out to the excellent testifylint by [@​brackendawson](https://github.com/brackendawson) in stretchr/testify#1568 - assert: fix typo in comment by [@​JohnEndson](https://github.com/JohnEndson) in stretchr/testify#1580 - Correct the EventuallyWithT and EventuallyWithTf example by [@​JonCrowther](https://github.com/JonCrowther) in stretchr/testify#1588 - CI: bump softprops/action-gh-release from 1 to 2 by [@​dependabot](https://github.com/dependabot) in stretchr/testify#1575 - mock: document more alternatives to deprecated AnythingOfTypeArgument by [@​dolmen](https://github.com/dolmen) in stretchr/testify#1569 - assert: Correctly document EqualValues behavior by [@​brackendawson](https://github.com/brackendawson) in stretchr/testify#1593 - fix: grammar in godoc by [@​miparnisari](https://github.com/miparnisari) in stretchr/testify#1607 - .github/workflows: Run tests for Go 1.22 by [@​HaraldNordgren](https://github.com/HaraldNordgren) in stretchr/testify#1629 - Document suite's lack of support for t.Parallel by [@​brackendawson](https://github.com/brackendawson) in stretchr/testify#1645 - assert: fix typos in comments by [@​alexandear](https://github.com/alexandear) in stretchr/testify#1650 - mock: fix doc comment for NotBefore by [@​alexandear](https://github.com/alexandear) in stretchr/testify#1651 - Generate better comments for require package by [@​Neokil](https://github.com/Neokil) in stretchr/testify#1610 - README: replace Testify V2 notice with [@​dolmen](https://github.com/dolmen)'s V2 manifesto by [@​hendrywiranto](https://github.com/hendrywiranto) in stretchr/testify#1518 #### New Contributors - [@​fahimbagar](https://github.com/fahimbagar) made their first contribution in stretchr/testify#1337 - [@​TomWright](https://github.com/TomWright) made their first contribution in stretchr/testify#820 - [@​snirye](https://github.com/snirye) made their first contribution in stretchr/testify#1433 - [@​myxo](https://github.com/myxo) made their first contribution in stretchr/testify#1582 - [@​JohnEndson](https://github.com/JohnEndson) made their first contribution in stretchr/testify#1580 - [@​JonCrowther](https://github.com/JonCrowther) made their first contribution in stretchr/testify#1588 - [@​miparnisari](https://github.com/miparnisari) made their first contribution in stretchr/testify#1607 - [@​marshall-lee](https://github.com/marshall-lee) made their first contribution in stretchr/testify#1481 - [@​spirin](https://github.com/spirin) made their first contribution in stretchr/testify#1644 - [@​ReyOrtiz](https://github.com/ReyOrtiz) made their first contribution in stretchr/testify#1637 - [@​stevenh](https://github.com/stevenh) made their first contribution in stretchr/testify#1421 - [@​jayd3e](https://github.com/jayd3e) made their first contribution in stretchr/testify#1636 - [@​Neokil](https://github.com/Neokil) made their first contribution in stretchr/testify#1610 - [@​redachl](https://github.com/redachl) made their first contribution in stretchr/testify#1586 - [@​ybrustin](https://github.com/ybrustin) made their first contribution in stretchr/testify#1663 - [@​sikehish](https://github.com/sikehish) made their first contribution in stretchr/testify#1664 - [@​arjun-1](https://github.com/arjun-1) made their first contribution in stretchr/testify#1626 **Full Changelog**: stretchr/testify@v1.9.0...v1.10.0 </details> --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119--> See merge request alpine/infra/build-server-status!18
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
internal/cleanup
Internal change to ease maintenance without external impact
internal/refactor
Refactor internals with no external visible changes
pkg-assert
Change related to package testify/assert
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Mark
assert.CompareType
as deprecated.Changes
Commits step by step:
compareResult
symbol name: d75ed1d, 539cfd9CompareType
tocompareResult
: fc30ce6CompareType
but mark it as deprecated: 05f46a6Motivation
assert.CompareType
has been introduced by 0b4ff03 and published since v1.6.0, but it is in fact only for internal usage and should never have been exposed.A search of usage of
assert.CompareType
on GitHub shows no results: https://github.com/search?q=assert.CompareType%20language%3AGo%20&type=repositoriesRelated issues
N/A