Skip to content

Disallow using @BeforeTest and @AfterTest #17680

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

Merged
merged 1 commit into from
May 30, 2023

Conversation

kokosing
Copy link
Member

Disallow using @BeforeTest and @AfterTest

@kokosing
Copy link
Member Author

As expected:

Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$ClassNotAlwaysRun.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$AllNotAlwaysRunTwice.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$AllNotAlwaysRunTwice.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$TestNotAlwaysRun.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$AllAlwaysRun.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$MethodNotAlwaysRun.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$SuiteNotAlwaysRun.java:-1: Prefer org.testng.annotations.AfterClass
Error:  /home/runner/work/trino/trino/testing/trino-testing-services/src/test/java/io/trino/testng/services/TestReportAfterMethodNotAlwaysRun$GroupNotAlwaysRun.java:-1: Prefer org.testng.annotations.AfterClass

@kokosing kokosing force-pushed the origin/master/179_junit branch from 5e27831 to f36977c Compare May 29, 2023 12:22
@kokosing
Copy link
Member Author

I removed @AfterClass usage from ReportAfterMethodNotAlwaysRun. I think it is fine, however I would like what do you think about it.

@ksobolew
Copy link
Contributor

I removed @AfterClass usage from ReportAfterMethodNotAlwaysRun. I think it is fine, however I would like what do you think about it.

Right. Didn't occur to me that they will trigger those checks. I'm fine with removing these tests - we're prohibiting these annotations after all, so we don't expect them to be used.

@kokosing kokosing force-pushed the origin/master/179_junit branch from f36977c to 42118b2 Compare May 29, 2023 13:55
@kokosing kokosing merged commit f3558f9 into trinodb:master May 30, 2023
@github-actions github-actions bot added this to the 419 milestone May 30, 2023
@kokosing kokosing deleted the origin/master/179_junit branch June 10, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants