Skip to content

Introduce utbot-spring-analyzer module #1818

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 13 commits into from
Mar 15, 2023

Conversation

tepa46
Copy link
Collaborator

@tepa46 tepa46 commented Feb 17, 2023

Description

utbot-spring-analyzer is a new module in UtBot required to generate tests for Spring applications.

This module will be called from UtBot in a separate process. For test and debug goals it may be run separately.

The base action chain of this module is the following:

  • obtains configuration classes from user application
  • creates a custom Spring application that uses the obtained config
  • gets all required information for analysis in UtBot (e.g. bean definitions)
  • stores this information (currently to a text file)
  • stops Spring before context initialization (currently deletes all bean definitions)

How to test

Manual tests

Prepare command line arguments:

  • arg0: classpath to projects under test
  • arg1: fully qualified name of configuration class

Verify that SpringBeans.txt file is generated and some bean class names are present there.

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@tepa46 tepa46 added ctg-enhancement New feature, improvement or change request comp-spring Issue is related to Spring projects support labels Feb 17, 2023
@tepa46 tepa46 requested a review from alisevych February 17, 2023 13:37
@EgorkaKulikov EgorkaKulikov self-requested a review February 20, 2023 05:22
@EgorkaKulikov EgorkaKulikov self-requested a review February 28, 2023 12:22
@EgorkaKulikov EgorkaKulikov force-pushed the kirill/spring-analyzer-sandbox branch from 8701582 to 8c93dba Compare March 15, 2023 12:33
@EgorkaKulikov EgorkaKulikov requested a review from alisevych March 15, 2023 20:29
@EgorkaKulikov
Copy link
Collaborator

Seems to be good enough for the first implementation to be merged. Improvement process will be continued.
Also we need to implement a runner for this functionality in another process for UtBot, would like to start this integration.
Functionality is harmless for UtBot and currently cannot be called from it.

@EgorkaKulikov EgorkaKulikov removed the request for review from alisevych March 15, 2023 20:32
@EgorkaKulikov EgorkaKulikov enabled auto-merge (squash) March 15, 2023 20:33
@EgorkaKulikov EgorkaKulikov merged commit ae2d567 into main Mar 15, 2023
@EgorkaKulikov EgorkaKulikov deleted the kirill/spring-analyzer-sandbox branch March 15, 2023 20:46
@EgorkaKulikov EgorkaKulikov restored the kirill/spring-analyzer-sandbox branch March 16, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-spring Issue is related to Spring projects support ctg-enhancement New feature, improvement or change request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants