Skip to content

Fix codegen to generate tests for nested classes into nested testclasses #560 #665

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
Aug 11, 2022

Conversation

volivan239
Copy link
Collaborator

@volivan239 volivan239 commented Aug 4, 2022

Description

Changed codegen so that now structure of generated test classes corresponds to structure of classes in src code, i.e. tests generated for methods from inner/nested classes are now put to inner/nested classes in testfile.

Fixes #560

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Automated Testing

Added tests for ClassWithStaticAndInnerClasses, more tests to be added

Manual Scenario

Run on example described in #560 -- tests for CaseFormat.StringConverter are generated in nested class

Checklist (remove irrelevant options):

This is the author self-check list

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@volivan239 volivan239 force-pushed the volivan239/improve_test_naming_for_nested_classes branch 3 times, most recently from 07b3120 to dec5883 Compare August 5, 2022 10:00
@volivan239
Copy link
Collaborator Author

In this PR some project tests were restructured. For example, LombokAnnotationTest had testClass = EnumWithAnnotations::class but, among others, contained tests for methods of EnumWithoutAnnotations and NotNullAnnotations, which caused incorrect behavior of codegen. Now this testclass is splitted.

@volivan239 volivan239 force-pushed the volivan239/improve_test_naming_for_nested_classes branch from dec5883 to 94833f3 Compare August 5, 2022 13:10
@volivan239 volivan239 marked this pull request as ready for review August 5, 2022 13:19
@volivan239 volivan239 mentioned this pull request Aug 10, 2022
7 tasks
@volivan239 volivan239 requested a review from ArsenHD August 10, 2022 14:10
@volivan239 volivan239 changed the title Fix codegen to generate tests for nested classes into nested testclasses Fix codegen to generate tests for nested classes into nested testclasses #560 Aug 11, 2022
@volivan239 volivan239 force-pushed the volivan239/improve_test_naming_for_nested_classes branch 2 times, most recently from 830dcc5 to eec6d59 Compare August 11, 2022 10:55
@volivan239 volivan239 force-pushed the volivan239/improve_test_naming_for_nested_classes branch from eec6d59 to 8191af5 Compare August 11, 2022 12:03
@volivan239 volivan239 merged commit 2e2d62a into main Aug 11, 2022
@volivan239 volivan239 deleted the volivan239/improve_test_naming_for_nested_classes branch August 11, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Inaccurate test naming for methods of nested classes
3 participants