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

review: test: introduce generated AssertJ asserts #5644

Merged
merged 17 commits into from
Feb 11, 2024

Conversation

SirYwell
Copy link
Collaborator

@SirYwell SirYwell commented Jan 29, 2024

This pull request introduces enhanced support for AssertJ for our test infrastructure. Specialized Assert classes allow directly testing for specific metamodel properties, reducing the repetitive code we currently write in tests.

The classes and interfaces are automatically generated, methods added to interfaces manually will persist when regenerating. To ensure consistency, we have a CI check that fails if regeneration is needed.

@MartinWitt
Copy link
Collaborator

The java 21 failures are related to:

Caused by: java.lang.IllegalArgumentException: Java 21 (65) is not supported by the current version of Byte Buddy which officially supports Java 20 (64) - update Byte Buddy or set net.bytebuddy.experimental as a VM property

@MartinWitt
Copy link
Collaborator

MartinWitt commented Jan 30, 2024

Okay @SirYwell's AssertJ version was built a long time ago in a galaxy far, far away. Updating AssertJ will fix this.

@SirYwell SirYwell force-pushed the feature/assertj-codegen branch from a5afb52 to 0c8568e Compare January 31, 2024 09:21
@SirYwell SirYwell marked this pull request as ready for review January 31, 2024 11:02
@SirYwell SirYwell changed the title wip: test: introduce generated AssertJ asserts review: test: introduce generated AssertJ asserts Jan 31, 2024
SirYwell and others added 15 commits February 11, 2024 09:46
The update adds an improvement for CtTypeReference processing in the AssertJCodegen.java file. It introduces the capacity to include wildcard type parameters when the type reference is created. This amend maintains the production of a complete, reliable, usable type reference, ultimately improving the test assertion performance.
Added a new line in the AssertJCodegen.java file to set super interfaces for the ctInterface object. This addition enhances the code generation test assertions.
Reduced the verbosity of the "codegen" script within the flake.nix file. This refactor makes the script more concise, resulting in code that's easier to understand. It still retains full functionality, including testing, applying spotless, and checking for uncommitted changes.
@SirYwell SirYwell force-pushed the feature/assertj-codegen branch from 0c8568e to 77d7c24 Compare February 11, 2024 08:46
The .github/workflows/tests.yml file has been modified to run codegen checks instead of executing tests with coverage. The environmental variables for the GitHub token and PR number have been removed, and the name for this action has been updated to reflect these changes.
The spotless-maven-plugin version has been upgraded from 2.41.1 to 2.43.0, and the palantirJavaFormat version has been boosted from 2.39.0 to 2.40.0. Also, Javadoc formatting has been enabled on palantirJavaFormat and the command for running codegen checks in the tests workflow file has been adjusted.
@MartinWitt MartinWitt merged commit 755ab36 into java17 Feb 11, 2024
12 checks passed
@MartinWitt MartinWitt deleted the feature/assertj-codegen branch February 11, 2024 22:40
MartinWitt added a commit that referenced this pull request Feb 11, 2024
Co-authored-by: I-Al-Istannen <[email protected]>
Co-authored-by: Martin Wittlinger <[email protected]>
I-Al-Istannen added a commit that referenced this pull request Apr 3, 2024
Co-authored-by: I-Al-Istannen <[email protected]>
Co-authored-by: Martin Wittlinger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants