-
Notifications
You must be signed in to change notification settings - Fork 45
Introduce custom JavaDoc tags #565 #585
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@onewhl
onewhl
added
the
comp-summaries
Something related to the method names, code comments and display names generation
label
Jul 25, 2022
utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt
Outdated
Show resolved
Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc/UtJavaDocInfoGenerator.kt
Outdated
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
Outdated
Show resolved
Hide resolved
@onewhl
onewhl
force-pushed
the
onewhl/565_custom_javadoc_tags
branch
3 times, most recently
from
August 8, 2022 07:51
55d9b35
to
38ca8c6
Compare
I would like to discuss several things.
- Is it OK to change global settings from UtSettings in tests (see SummaryTestCaseGeneratorTest)? The order of tests is non-determined, it seems it possible could lead to errors. I used JUnit extension to avoid it.
- Is it possible to show error message in CI logs in case test fail?
Damtev
Damtev
previously requested changes
Aug 8, 2022
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt
Outdated
Show resolved
Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt
Outdated
Show resolved
Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt
Outdated
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc/UtCustomJavaDocTagProvider.kt
Outdated
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc/UtCustomJavaDocTagProvider.kt
Outdated
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
Outdated
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
Outdated
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocTagProvider.kt
Outdated
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleCommentBuilder.kt
Show resolved
Hide resolved
Damtev
Damtev
reviewed
Aug 8, 2022
I would like to discuss several things.
- Is it OK to change global settings from UtSettings in tests (see SummaryTestCaseGeneratorTest)? The order of tests is non-determined, it seems it possible could lead to errors. I used JUnit extension to avoid it.
- Is it possible to show error message in CI logs in case test fail?
- Mostly it is not OK, just because of your mentioned, reasons, so we use a lot of util functions that change them only for specific tests. You can see some examples in the
org.utbot.examples.UtValueTestCaseChecker
file, likewithoutMinimization
and others. But I suppose your way is acceptable too. - I am not sure about common logs, but we publish some artifacts after a pipeline ending, that you can find in the pipeline summary tab. One of them is
utbot_framework_logs
, which is a simple gradle tests report. In this report, you can find logs and, most importantly, test output for each test.
@onewhl
onewhl
force-pushed
the
onewhl/565_custom_javadoc_tags
branch
from
August 17, 2022 11:04
c067536
to
22b6623
Compare
amandelpie
amandelpie
requested changes
Aug 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make some minor changes
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt
Show resolved
Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/Summarization.kt
Outdated
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
Show resolved
Hide resolved
utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
Show resolved
Hide resolved
@onewhl
onewhl
force-pushed
the
onewhl/565_custom_javadoc_tags
branch
2 times, most recently
from
August 23, 2022 11:51
3723680
to
7ad3155
Compare
...erate comment content with HTML tags, we need only replace custom tags' names with their messages to make it look nice
@onewhl
onewhl
force-pushed
the
onewhl/565_custom_javadoc_tags
branch
from
August 24, 2022 11:31
5ceb39f
to
bd616a9
Compare
amandelpie
amandelpie
approved these changes
Aug 24, 2022
@amandelpie
amandelpie
dismissed
Damtev’s stale review
August 24, 2022 12:16
The most part of requirements were implemented
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Description
Introduce custom JavaDoc tags to make generated code comments structured.
@utbot.classUnderTest
- Inline link to the enclosing class.@utbot.methodUnderTest
- Inline link to the method we test.@utbot.expectedResult
- Value we expect to get.@utbot.actualResult
- Value we got.@utbot.executes
- Executed condition.@utbot.invokes
- Invoked method.@utbot.returnsFrom
- Statement we return from.@utbot.throwsException
- Thrown exception.The list of tags could be expanded
We show only tags that have some non-null value. After plugin's removal, IDE doesn't recognize our custom tags. It doesn't lead to errors, but highlights tags with yellow color.
TODO: Add a test in the intellij module in separate PR
TODO: @amandelpie suggested to add a tag for display name in (PR-624) in case of JUnit4 in separate PR.
TODO: After upgrading to 2022.1 fix comment rendering in separate PR by using default JavaDocInfoGenerator.
Fixes #565
Type of Change
How Has This Been Tested?
Automated Testing
Run tests
SummaryConditionsTest
,SummaryMinStackTest
,SummaryExceptionClusteringExamplesTest
.Manual Scenario
Set
useFuzzing = false
anduseCustomJavaDocTags=true
inUtSettings
.Case 1: check that tags are supported and shown in IDE.
@utbot
-> you will notice that completion works and our custom tags are shown.Case 2: check that the plugin generates comments using custom tags.
Create tests with UTBot
actionTested using runIde command.
Checklist (remove irrelevant options):