Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(deps): update dependency com.google.truth:truth to v1.4.5#1890

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
renovate-bot wants to merge1 commit intogoogleapis:main
base:main
Choose a base branch
Loading
fromrenovate-bot:renovate/com.google.truth-truth-1.x

Conversation

@renovate-bot
Copy link
Contributor

@renovate-botrenovate-bot commentedOct 18, 2023
edited
Loading

This PR contains the following updates:

PackageChangeAgeConfidence
com.google.truth:truth1.1.3 ->1.4.5ageconfidence

Release Notes

google/truth (com.google.truth:truth)

v1.4.5: 1.4.5

  • Changed assertions likeassertThat(nullMap).isEmpty() to fail with a useful failure message instead of throwingNullPointerException (and similarly for other "bogus" values, such as negative sizes). (da5d6e9)
  • Made Kotlin'sisInstanceOf(Int::class.java) (and Java'sisInstanceOf(int.class)) a valid way to check forInt/Integer instances. (974ef19)
  • ImprovedisWithin to pretty-print numbers in its failure messages. (de78553,07318c2)
  • Improved some assertions that print class names to print simpler names (e.g.,Integer instead ofjava.lang.Integer). (0ba72d6)
  • ChangedExpectFailure to never generate "value of" lines based on bytecode. This slightly simplifies writing new tests withExpectFailure and prevents future behavior changes in someExpectFailure tests that already exist. However, it may also require changes to other existingExpectFailure tests to remove or change any assertions about the "value of" line. (3caa0e8)
  • Our AndroidminSdkVersion is now 23 (Marshmallow). This follows the minimum of Google's foundational Android libraries, and we expect it to have no practical impact on users. (c85c75c)
  • Changed our GWT/J2CL artifact to omit usages of@NullMarked. This was making all our types non-null in those environments, since we don't yet use@Nullable in the GWT/J2CL artifact. (6392d37)

v1.4.4

  • Annotated the rest of the main package for nullness, and moved the@NullMarked annotation from individual classes up to the package to avoida warning under--release 8. (e107aea)
  • Improved the failure message formatches to conditionally suggest usingcontainsMatch. (7e9fc7a)

v1.4.3: 1.4.3

Known Issue for at least some builds targeting Java 8, fixed in1.4.4: "unknown enum constant ElementType.MODULE":#​1320. As far as we know, this is only a warning, so it should cause practical problems only if you use-Werror or you perform reflection on@NullMarked under a Java 8 runtime.

  • Added more nullness information to our APIs (in the form ofJSpecify annotations). This could lead to additional warnings (or even errors) for users of Kotlin and other nullness checkers. Pleasereport any problems. (ee680cb)
  • DeprecatedSubject.Factory methods for Java 8 types. We won't remove them, but you can simplify your code by migrating off them: Just replaceassertAbout(foos()).that(foo) withassertThat(foo) (orabout(foos()).that(foo) withthat(foo)). (59e7a50)

v1.4.2: 1.4.2

This release is the final step of copying all our methods fromTruth8 toTruth. If you have not already migrated your usages fromTruth8 toTruth, you may see build errors:

OptionalSubjectTest.java:39: error: reference to assertThat is ambiguous    assertThat(Optional.of("foo")).isPresent();    ^  both method assertThat(@&#8203;org.checkerframework.checker.nullness.qual.Nullable Optional<?>) in Truth8 and method assertThat(@&#8203;org.checkerframework.checker.nullness.qual.Nullable Optional<?>) in Truth match

In most cases, you can migrate your whole project mechanically:git grep -l Truth8 | xargs perl -pi -e 's/\bTruth8\b/Truth/g;'. (You can make that change before upgrading to Truth 1.4.2 or as part of the same commit.)

If you instead need to migrate your project incrementally (for example, because it is very large), you may want to upgrade your version of Truth incrementally, too, following our instructions for1.3.0 and1.4.0.

For help

Please feel welcome toopen an issue to report problems or request help.

Changelog

  • Removed temporary type parameters fromTruth.assertThat(Stream) andTruth.assertThat(Optional). This can create build errors, which you can fix by replacing all your references toTruth8 with references toTruth. (45782bd)

v1.4.1: 1.4.1

This release deprecatesTruth8.

All its methods have become available on the mainTruth class. In most cases, you can migrate your whole project mechanically:git grep -l Truth8 | xargs perl -pi -e 's/\bTruth8\b/Truth/g;'

While we do not plan to deleteTruth8, we recommend migrating off it, at least if you static importassertThat: If you do not migrate, such static imports become ambiguous in Truth 1.4.2, breaking your build.

v1.4.0: 1.4.0

In this release, our assertions on Java 8 types continue to move from theTruth8 class to the mainTruth class. This change should not break compatibility for any supported JDK or Android version, even users who test under old versions of Android withoutAPI desugaring. Additionally, we will never break binary compatibility, though some users will have to make changes to their source code in order for it to compile against newer versions.

This release is likely to lead to morebuild failures than1.3.0 did. However, those failures should bestraightforward to fix.

Example build failure

Foo.java:152: error: reference to assertThat is ambiguous    assertThat(repo.findFileWithName("foo")).isNull();    ^  both method assertThat(@&#8203;org.checkerframework.checker.nullness.qual.Nullable Path) in Truth8 and method assertThat(@&#8203;org.checkerframework.checker.nullness.qual.Nullable Path) in Truth match

Simplest upgrade strategy (if you can update all your code atomically in the same commit as the Truth upgrade)

In the same commit:

  1. Upgrade Truth to 1.4.0.
  2. Replaceimport static com.google.common.truth.Truth8.assertThat; withimport static com.google.common.truth.Truth.assertThat;.
    • If you use Kotlin, replaceimport com.google.common.truth.Truth8.assertThat withimport com.google.common.truth.Truth.assertThat.
  3. Replaceimport com.google.common.truth.Truth8; withimport com.google.common.truth.Truth;.
    • again, similarly for Kotlin if needed
  4. Optionally replace remaining references toTruth8 with references toTruth.
    • For example, replaceTruth8.assertThat(optional).isPresent() withTruth.assertThat(optional).isPresent().

If you're feeling lucky, you can try this one-liner for the code updates:

git grep -l Truth8| xargs perl -pi -e's/import static com.google.common.truth.Truth8.assertThat;/import static com.google.common.truth.Truth.assertThat;/g; s/import com.google.common.truth.Truth8.assertThat/import com.google.common.truth.Truth.assertThat/g; s/import com.google.common.truth.Truth8/import com.google.common.truth.Truth/g; s/\bTruth8[.]/Truth./g;'

In most cases, that can be further simplified to:

git grep -l Truth8| xargs perl -pi -e's/\bTruth8\b/Truth/g;'

After that process, it is possible that you'll still see build errors from ambiguous usages ofassertThat static imports. If so, you can find a workaround in the section about overload ambiguity in the release notes for1.3.0. Alternatively, you can wait to upgrade until after a future Truth release, which will eliminate the ambiguity by changing the signatures of someTruth.assertThat overloads.

Incremental upgrade strategy

If you have a very large repo or you have other reasons to prefer to upgrade incrementally, you can use the approach that we used inside Google. Roughly, that approach was:

  1. Make the optional changes discussed in the release notes for1.3.0.
  2. For any remaining calls toTruth8.assertThat, change them toavoid static import.
    • That is, replaceassertThat(optional).isPresent() withTruth8.assertThat(optional).isPresent().
  3. Upgrade Truth to 1.4.0.
  4. Optionally replace references toTruth8 with references toTruth (including restoring static imports if desired), as discussed in section about the simple upgrade strategy above.

Optional additional changes

  • If you useassertWithMessage(...).about(intStreams()).that(...),expect.about(optionalLongs()).that(...), or similar, you can remove your call toabout. This change will never be necessary; it is just a simplification.
    • This is similar to a previous optional change from1.3.0, except that 1.3.0 solved this problem forstreams andoptionals, whereas 1.4.0 solves it for the otherTruth8 types.

For help

Please feel welcome toopen an issue to report problems or request help.

Changelog

  • Added the remainingTruth8.assertThat overloads to the mainTruth class. (9be8e77,1f81827)
  • Added morethat overloads to make it possible to write type-specific assertions when using the remaining Java 8 types. (7c65fc6)

v1.3.0: 1.3.0

In this release, our assertions on Java 8 types begin to move from thetruth-java8-extensions artifact and theTruth8 class to the maintruth artifact and theTruth class. This change should not break compatibility for any supported JDK or Android version, even users who test under old versions of Android withoutAPI desugaring. Additionally, we will never break binary compatibility, though some users will have to make changes to their source code in order for it to compile against newer versions.

This change will be routine for most users, but we're providing as much information as we can for any users who do encounter problems.

We will post fuller instructions for migration later on, once we've learned more from our internal migration efforts. For now, you may find that you need to make one kind of change, and you may elect to make others. (If we missed anything, pleaseopen an issue to report problems or request help.)

The change you might need to make:

  • By adding new overloads ofTruth.assertThat, we cause some code to fail to compile because of an overload ambiguity. This is rare, but it can happen if you static import bothTruth.assertThat and some otherassertThat method that includes overloads forOptional orStream. (It doesnot happen forTruth8.assertThat, though, except with the Eclipse compiler. Nor it doesnecessarily happen for otherassertThat(Stream) andassertThat(Optional) methods.) If this happens to you, you'll need to remove one of the static imports, changing the corresponding call sites from "assertThat" to "FooSubject.assertThat."
    • Alternatively, you may choose to wait until we make further changes to the newTruth.assertThat overloads. Once we make those further changes, you may be able to simultaneously replace all your imports ofTruth8.assertThat with imports ofTruth.assertThat as you upgrade to the new version, likely without introducing overload ambiguities.

The changes you might elect to make:

  • If you useTruth8.assertThat(Stream) orTruth8.assertThat(Optional), you can migrate to the new overloads inTruth. If you static importTruth8.assertThat, you can usually make this change simply by replacing that static import with a static import ofTruth.assertThat—or, if you already have an import ofTruth.assertThat, by just removing the import ofTruth8.assertThat. (If you additionally use less common assertion methods, likeassertThat(OptionalInt), you'll want to useboth imports for now. Later, we'll moveassertThat(OptionalInt) and friends, too.) We recommend making this change now, since your calls toTruth8.assertThat will fail to compile against some future version of Truth, unless you plan to wait to update your Truth dependency until we've made all our changes for Java 8 types.

  • If you useassertWithMessage(...).about(streams()).that(...),expect.about(optionals()).that(...), or similar, you can remove your call toabout. This change will never be necessary; it is just a simplification.

  • If you depend ontruth-java8-extension, you may remove it. All its classes are now part of the maintruth artifact. This change, too, is not necessary; it is just a simplification. (OK, if your build system has a concept ofstrict deps, there is a chance that you'llneed to add deps ontruth to replace your deps ontruth-java8-extension.)

Finally, the changelog for this release:

  • MadeStreamSubject avoid collecting theStream until necessary, and made itsisEqualTo andisNotEqualTo methods no longer always throw. (f8ecaec)
  • AddedassertThat overloads forOptional andStream to the mainTruth class. (37fd8be)
  • Addedthat overloads to make it possible to write type-specific assertions when usingexpect.that(optional) andexpect.that(stream). (ca7e8f4)
  • Moved thetruth-java8-extension classes into the maintruth artifact. There is no longer any need to depend ontruth-java8-extension, which is now empty. (We've also removed theTruth8GWT module.) (eb0426e)

Again, if you have any problems, pleaselet us know.

v1.2.0: 1.2.0

  • Fixed a bug that caused ProtoTruth to ignore the contents of unpackedAny messages. This fix may cause tests to fail, since ProtoTruth will now check whether the message contents match. If so, you may need to change the values that your tests expect, or there may be a bug in the code under test that had been hidden by the Truth bug. Sorry for the trouble. (8bd3ef6)
  • AddedisWithin().of() support toIntegerSubject andLongSubject. (6464cb5,0e99a27)

v1.1.5: 1.1.5

  • Updated Truth to depend onGuava 32.0.1. The previous Guava version, 32.0.0, contained a bug under Windows, which did not affect Truth's functionality butcould cause problems for people who use Guava's I/O functionality in their codebase. Affected users can already manually update their Guava dependency to 32.0.1, but if they don't depend directly on Guava, they may find it easier to upgrade to this new Truth release instead.
  • FixedIterableOfProtosSubject to produce a proper failure message instead of NPE when the actual value isnull.

v1.1.4: 1.1.4

  • Updated Truth to build with-source 8 -target 8. This means that it no longer runs under Java 7 VMs. It continues to run under Android, even old versions, for all apps that haveenabled support for Java 8 language features. (db5db24)
  • Updated Truth to depend on Guava 32.0.0. That release contains changes related to CVEs. Neither of the CVEs relates to any methods that are used by Truth, so this version bump is just about eliminating any warnings related to the old version and helping tools like Maven to select the newest version of Guava. (f8d4dbb,99b1df8)
  • Added support forvalue of: method() toexpect.that, matching the existing support forassertThat. (bd8efd0)
  • EnhancedIterableSubject.containsAtLeastElementsIn().inOrder() to print an extra line that shows only the expected elements in their actual order. (9da7dd1)
  • Annotated Truth for nullness. (2151add)

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 PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated byMend Renovate. View therepository job log.

@renovate-botrenovate-bot requested a review froma team as acode ownerOctober 18, 2023 22:20
@trusted-contributions-gcftrusted-contributions-gcfbot added kokoro:force-runAdd this label to force Kokoro to re-run the tests. owlbot:runAdd this label to trigger the Owlbot post processor. labelsOct 18, 2023
@product-auto-labelproduct-auto-labelbot added the size: xsPull request size is extra small. labelOct 18, 2023
@gcf-owl-botgcf-owl-botbot removed the owlbot:runAdd this label to trigger the Owlbot post processor. labelOct 18, 2023
@renovate-botrenovate-bot changed the titletest(deps): update dependency com.google.truth:truth to v1.1.5test(deps): update dependency com.google.truth:truth to v1.2.0Dec 19, 2023
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch fromce6b5ac tob789b3cCompareDecember 19, 2023 19:26
@trusted-contributions-gcftrusted-contributions-gcfbot added the owlbot:runAdd this label to trigger the Owlbot post processor. labelDec 19, 2023
@gcf-owl-botgcf-owl-botbot removed the owlbot:runAdd this label to trigger the Owlbot post processor. labelDec 19, 2023
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelDec 19, 2023
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch fromb789b3c tob0dcd9bCompareJanuary 20, 2024 01:25
@renovate-botrenovate-bot changed the titletest(deps): update dependency com.google.truth:truth to v1.2.0test(deps): update dependency com.google.truth:truth to v1.3.0Jan 20, 2024
@trusted-contributions-gcftrusted-contributions-gcfbot added kokoro:force-runAdd this label to force Kokoro to re-run the tests. owlbot:runAdd this label to trigger the Owlbot post processor. labelsJan 20, 2024
@gcf-owl-botgcf-owl-botbot removed the owlbot:runAdd this label to trigger the Owlbot post processor. labelJan 20, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJan 20, 2024
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch fromb0dcd9b tod4763e6CompareFebruary 2, 2024 19:38
@renovate-botrenovate-bot changed the titletest(deps): update dependency com.google.truth:truth to v1.3.0test(deps): update dependency com.google.truth:truth to v1.4.0Feb 2, 2024
@trusted-contributions-gcftrusted-contributions-gcfbot added kokoro:force-runAdd this label to force Kokoro to re-run the tests. owlbot:runAdd this label to trigger the Owlbot post processor. labelsFeb 2, 2024
@gcf-owl-botgcf-owl-botbot removed the owlbot:runAdd this label to trigger the Owlbot post processor. labelFeb 2, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelFeb 2, 2024
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch fromd4763e6 to1c36361CompareFebruary 16, 2024 21:19
@renovate-botrenovate-bot changed the titletest(deps): update dependency com.google.truth:truth to v1.4.0test(deps): update dependency com.google.truth:truth to v1.4.1Feb 16, 2024
@trusted-contributions-gcftrusted-contributions-gcfbot added kokoro:force-runAdd this label to force Kokoro to re-run the tests. owlbot:runAdd this label to trigger the Owlbot post processor. labelsFeb 16, 2024
@gcf-owl-botgcf-owl-botbot removed the owlbot:runAdd this label to trigger the Owlbot post processor. labelFeb 16, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelFeb 16, 2024
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch from1c36361 to48420e7CompareFebruary 29, 2024 22:09
@renovate-botrenovate-bot changed the titletest(deps): update dependency com.google.truth:truth to v1.4.1test(deps): update dependency com.google.truth:truth to v1.4.2Feb 29, 2024
@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelNov 19, 2024
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch froma1154d5 to35b7ff2CompareNovember 19, 2024 20:59
@dpebot
Copy link

/gcbrun

@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelNov 19, 2024
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch from35b7ff2 todd552faCompareJanuary 23, 2025 18:34
@dpebot
Copy link

/gcbrun

@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJan 23, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJan 23, 2025
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch fromdd552fa to35039dfCompareFebruary 4, 2025 20:25
@dpebot
Copy link

/gcbrun

@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelFeb 4, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelFeb 4, 2025
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch from35039df to9123c59CompareApril 30, 2025 11:42
@dpebot
Copy link

/gcbrun

@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelApr 30, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelApr 30, 2025
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch from9123c59 to31b5f14CompareJune 9, 2025 07:51
@dpebot
Copy link

/gcbrun

@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJun 9, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelJun 9, 2025
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch from31b5f14 tocaf8fcfCompareSeptember 10, 2025 18:06
@renovate-botrenovate-bot changed the titletest(deps): update dependency com.google.truth:truth to v1.4.4test(deps): update dependency com.google.truth:truth to v1.4.5Sep 10, 2025
@dpebot
Copy link

/gcbrun

@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelSep 10, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelSep 10, 2025
@renovate-botrenovate-botforce-pushed therenovate/com.google.truth-truth-1.x branch fromcaf8fcf toe3e8d6aCompareOctober 21, 2025 10:04
@dpebot
Copy link

/gcbrun

@trusted-contributions-gcftrusted-contributions-gcfbot added the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelOct 21, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelOct 21, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

do not mergeIndicates a pull request not ready for merge, due to either quality or timing.size: xsPull request size is extra small.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@renovate-bot@diegomarquezp@dpebot@yoshi-kokoro

[8]ページ先頭

©2009-2025 Movatter.jp