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

Duplicate Summaries with Tags in Rendered view #985

Closed
alisevych opened this issue Sep 21, 2022 · 2 comments · Fixed by #1015
Closed

Duplicate Summaries with Tags in Rendered view #985

alisevych opened this issue Sep 21, 2022 · 2 comments · Fixed by #1015
Assignees
Labels
comp-summaries Something related to the method names, code comments and display names generation ctg-bug Issue is a bug

Comments

@alisevych
Copy link
Member

Description

Summaries are duplicated when rendering mode is on.
Also annotations and method name are duplicated above the Java doc.

To Reproduce

  1. Run the 'UTBotJava' project in IntelliJ Idea 2022.1.4
  2. Open utbot-sample/src/test/java/org/utbot/examples/algorithms/ArraysQuickSortTest.java
  3. Use one of the latest builds of plugin to generate tests
  4. Open the generated test
  5. Find tests in SYMBOLIC EXECUTION ENGINE: ERROR SUITE
  6. Render Java docs (Ctrl+Alt+Q)

Expected behavior

Java docs should be rendered correctly - without duplications.

Actual behavior

Tagged information is duplicated.
Annotations and method name are duplicated above the Java doc.

Visual proofs (screenshots, logs, images)

Test in rendered view:

image

Test in text mode:

/**
     * @utbot.classUnderTest {@link ArraysQuickSort}
     * @utbot.methodUnderTest {@link ArraysQuickSort#sort(int[], int, int, int[], int, int)}
     * @utbot.executesCondition {@code (right - left < 286): True},
     * {@code (null): False}
     * @utbot.invokes {@link ArraysQuickSort#sort(int[], int, int, boolean)}
     * @utbot.throwsException {@link ArrayIndexOutOfBoundsException} in: internalSort(a, left, right, true);
     */
    @Test
    @DisplayName("sort: internalSort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
    public void testSort_ThrowArrayIndexOutOfBoundsException() {
        int[] a = {1, 1};

        /* This test fails because method [org.utbot.examples.algorithms.ArraysQuickSort.sort] produces [java.lang.ArrayIndexOutOfBoundsException] */
        ArraysQuickSort.sort(a, -208, 71, null, -255, -255);
    }

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.4
JDK 11

@alisevych alisevych added ctg-bug Issue is a bug comp-summaries Something related to the method names, code comments and display names generation labels Sep 21, 2022
@korifey korifey moved this to Todo in UTBot Java Sep 21, 2022
@alisevych
Copy link
Member Author

@amandelpie Just FYI

@alisevych
Copy link
Member Author

@onewhl There are additional details on the bug.

Additional context

If UTBotJava plugin is uninstalled, same Java docs in the generated test classes are rendered correctly - without duplicating.

onewhl added a commit that referenced this issue Sep 28, 2022
* Avoid summary duplication #985

* Fix rendering for 2022.1.4
Repository owner moved this from Todo to Done in UTBot Java Sep 28, 2022
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this issue Oct 17, 2022
* Avoid summary duplication UnitTestBot#985

* Fix rendering for 2022.1.4
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this issue Oct 17, 2022
* Avoid summary duplication UnitTestBot#985

* Fix rendering for 2022.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-summaries Something related to the method names, code comments and display names generation ctg-bug Issue is a bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants