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

Add arch test for preview API usage #983

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

marcoferrer
Copy link
Contributor

@marcoferrer marcoferrer commented Nov 25, 2020

Description

This PR introduces the concept of architecture tests to the project. The first test implemented verifies that any method or class that is annotated @Preview is also annotated with @Deprecated.

The library used to implement the tests is ArchUnit

The following is an example of the output created when this test fails.
image

Before submitting a PR:

We love getting PRs, but we hate asking people for the same basic changes every time.

  • Push your changes to a branch other than master. Create your PR from that branch.
  • Add JavaDocs and other comments
  • Write tests that run and pass in CI. See CONTRIBUTING.md for details on how to capture snapshot data.
  • Run mvn clean compile locally. This may reformat your code, commit those changes.
  • Run mvn -D enable-ci clean install site locally. If this command doesn't succeed, your change will not pass CI.

When creating a PR:

  • Fill in the "Description" above.
  • Enable "Allow edits from maintainers".

@marcoferrer
Copy link
Contributor Author

@bitwiseman Based on the discussion we had in this PR #960

I decided to implement some architecture tests to cover the @Deprecated requirement via CI.

Thoughts?

Copy link
Member

@bitwiseman bitwiseman left a comment

Choose a reason for hiding this comment

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

I like this. Seems reasonable. Please address the one comment so far and then I'll merge.

@marcoferrer marcoferrer force-pushed the add-preview-arch-rules branch from 5504d1f to 459d1b4 Compare December 15, 2020 17:41
@marcoferrer
Copy link
Contributor Author

@bitwiseman addressed feedback, simplified implementation, added another rule to check for preview APIs in enum fields

@bitwiseman bitwiseman merged commit 1da8416 into hub4j:master Dec 15, 2020
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