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

Development: Execute architecture tests during java style action #7160

Merged
merged 13 commits into from
Sep 14, 2023

Conversation

Strohgelaender
Copy link
Contributor

@Strohgelaender Strohgelaender commented Sep 8, 2023

Checklist

General

Motivation and Context

We use architecture tests with ArchUnit to ensure that the code follows some general rules.
@jakubriegel pointed out that these tests are currently only run during a full server test run, which can take a while. Instead of letting developers wait until all server tests are finished, these special tests should be executed separately to quickly review issues.

Description

We now execute the ArchitecureTests directly in the server-style action.

Steps for Testing

code review

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Screenshots

grafik

@Strohgelaender Strohgelaender marked this pull request as ready for review September 8, 2023 12:42
@Strohgelaender Strohgelaender requested a review from a team as a code owner September 8, 2023 12:42
Copy link
Contributor

@DominikRemo DominikRemo 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 the idea behind faster feedback from Architecture Tests, especially for new developers 👍

However, the action now takes ~4:15 instead of ~2:30 minutes

AbstractArchitectureTest extends the BambooBitbucketJiraTest and therefore requires a lengthy server start (e.g., locally, the architecture tests run in less than two seconds, but with the server start, the tests took 34 seconds)

Most tests in the inheriting classes (ArchitectureTest, AuthorizationTest & FeedbackArchitectureTest) seem to be Unit Tests already. The only test actually requiring an application context is the testEndpoints() Test in the AuthorizationTest class.
Maybe we could move this one test somewhere else and make the entire AbstractArchitectureTest a Unit test, preventing the lengthy server start?

If we add an @Tag('ServerStyleTest') (JUnit Docs: Tags) annotation to the AbstractArchitectureTest, we should also be able to start all Tests extending the AbstractArchitectureTest (./gradlew test -DincludeTags='ServerStyleTest')

@github-actions github-actions bot added the tests label Sep 8, 2023
@Strohgelaender Strohgelaender added this to the 6.4.3 milestone Sep 8, 2023
Copy link
Contributor

@DominikRemo DominikRemo left a comment

Choose a reason for hiding this comment

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

Thank you for this improvement @Strohgelaender and thank you for the suggestion @jakubriegel.
This will help us, and especially new developers, detect architecture failures much faster 🚀

Copy link
Contributor

@laadvo laadvo left a comment

Choose a reason for hiding this comment

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

A very nice addition. Thanks for implementing it!

Copy link
Contributor

@jakubriegel jakubriegel left a comment

Choose a reason for hiding this comment

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

Thank you for that change!

@krusche krusche modified the milestones: 6.4.3, 6.5.0 Sep 9, 2023
@krusche krusche changed the title Development: Execute Architecture tests during java style action Development: Execute architecture tests during java style action Sep 14, 2023
@krusche krusche merged commit 21e611b into develop Sep 14, 2023
31 of 43 checks passed
@krusche krusche deleted the chore/architecture-style branch September 14, 2023 08:59
DominikRemo added a commit that referenced this pull request Sep 14, 2023
Order got reshuffled by #7160 after we have already fixed many flaky tests.
A fixed order might mitigate this issue.

Co-Authored-By: Lara Dvorsek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants