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

Use junit-pioneer to simplify polluted tests #1194

Conversation

abelsromero
Copy link
Member

Kind of change

  • Bug fix
  • New non-breaking feature
  • New breaking feature
  • Documentation update
  • Build improvement

Description

What is the goal of this pull request?

Simplify Gradle build and fix some IDE integration issues. See #1193 for details.

How does it achieve that?

  • Add junit-pioneer to inject environment variables into tests. This allows removing custom Gradle task pollutedTest and running them normally.
  • Refactor WhenAnAsciidoctorClassIsInstantiatedInAnEnvironmentWithGemPath as a parametrized tests.
  • Add missing cases for Asciidoctor Factory in WhenAnAsciidoctorClassIsInstantiatedInAnEnvironmentWithGemPath.

Are there any alternative ways to implement this?

Discussed in #1193.

Are there any implications of this pull request? Anything a user must know?

No, if anything, it should be easier for contributors now.

Issue

If this PR fixes an open issue, please add a line of the form:

Fixes #1193

Release notes

Please add a corresponding entry to the file CHANGELOG.adoc

@abelsromero abelsromero force-pushed the issue-1193-use-junit-pioneer-to-simplify-polluted-tests branch from 61f1a53 to fbc6ff9 Compare May 1, 2023 19:04
@abelsromero
Copy link
Member Author

I added the missing Asciidoctor Factory cases and asserted them based on the returned values. @robertpanzer cpould you please double-check nothing is wrong?

@abelsromero abelsromero marked this pull request as draft May 2, 2023 06:33
@abelsromero
Copy link
Member Author

"drafting" while I look into the test that failed 😞

@abelsromero abelsromero force-pushed the issue-1193-use-junit-pioneer-to-simplify-polluted-tests branch from fbc6ff9 to 0e5b661 Compare May 2, 2023 21:02
* Add junit-pioneer to inject environment variables into tests. This allows
removing custom Gradle task pollutedTest and running them normally.
* Refactor WhenAnAsciidoctorClassIsInstantiatedInAnEnvironmentWithGemPath
as a parametrized tests.
* Add missing cases for Asciidoctor Factory in
WhenAnAsciidoctorClassIsInstantiatedInAnEnvironmentWithGemPath.

Fixes asciidoctor#1193
@abelsromero abelsromero marked this pull request as ready for review May 2, 2023 21:36
@abelsromero
Copy link
Member Author

I had to apply a workaround for Windows builds only to set --add-opens to the test task.
Not elegant but allows us to keep the code and overall configuration simpler than before.

@robertpanzer
Copy link
Member

Thanks! 👍

@robertpanzer robertpanzer merged commit 85a294e into asciidoctor:main May 4, 2023
@abelsromero abelsromero deleted the issue-1193-use-junit-pioneer-to-simplify-polluted-tests branch May 9, 2023 20:35
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.

Do not run 'pollutedTests' task as a dependency of 'test'
2 participants