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

Re-implement enum documentation test #3762

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

adam-enko
Copy link
Member

@adam-enko adam-enko commented Aug 26, 2024

Re-implement the enum documentation test to download and use the actual Kotlin stdlib enum source code for the synthetic enum functions.

This avoids hardcoding a URL, and helps ensure the tests are properly cacheable (so they don't dynamically download files at runtime).

  • Add a utility, downloadKotlinStdlibJvmSources(), to download the Kotlin stdlib source code.
  • Move StdLibDocumentationIntegrationTest.kt to plugin-base since it's not really an integration test, and otherwise it's hard to access the actual enum template files.
  • Update the enum template tests to test all templates.

Re-implement the enum documentation test to download and use the actual Kotlin stdlib enum source code for the synthetic enum functions.

This avoids hardcoding a URL, and helps ensure the tests are properly cacheable (so they don't dynamically download files at runtime).

- Add a utility, `downloadKotlinStdlibSources()`, to download the Kotlin stdlib source code.
- Move StdLibDocumentationIntegrationTest.kt to plugin-base since it's not really an integration test, and otherwise it's hard to access the actual enum template files.
- Update the enum template tests to test all templates.
@adam-enko adam-enko marked this pull request as ready for review August 26, 2024 12:56
@adam-enko adam-enko self-assigned this Aug 26, 2024
Copy link
Collaborator

@whyoleg whyoleg left a comment

Choose a reason for hiding this comment

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

Thanks!
The approach looks good to me, the only problem I see is with version of stdlib which is used for comparing.
We used master version, but now we will use some specific version, so we will lag behind a bit. Not sure it will really matter.

@adam-enko adam-enko requested a review from whyoleg August 27, 2024 13:45
@IgnatBeresnev
Copy link
Member

Move StdLibDocumentationIntegrationTest.kt to plugin-base since it's not really an integration test, and otherwise it's hard to access the actual enum template files.

For context: I added it as an integration test became it made a network request that could hang, return an error or produce unexpected results. That's somewhat expected from integration (e2e) tests, but I certainly wouldn't expect unit tests to fail if GitHub is down

@dkrasnoff
Copy link

Good job! 👍

@adam-enko adam-enko merged commit 94e979b into master Aug 29, 2024
14 checks passed
@adam-enko adam-enko deleted the adam/feat/update-enum-kdoc-template-test branch August 29, 2024 12:30
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.

4 participants