konveyor / tackle-test-generator-cli

Apache License 2.0
58 stars 34 forks source link

Unable to execute Tackle-Test without errors #340

Open heidenthal-gtisoft opened 1 year ago

heidenthal-gtisoft commented 1 year ago

I work on a Gradle multi-project for which I would like to generate unit tests. As suggested, I am attempting to analyze a small portion of the project before analyzing the whole thing.

Because this is a Gradle multi-project, we only have one settings.gradle file, so when attempting to provide different app_build_files entries, the same settings.gradle file was used repeatedly.

I tried several different app_build_files configurations, but what it came down to are the two configurations in my toml file. One is commented out, so that the other could be used.

There are different failures, none of which really make sense to me.

1st Configuration Resulted in the Gradle output in tkltest_2.4.4_gradle_output_configuration_1.txt The unidentified plugin is in the base build.gradle file. I commented it out in the sub-project gradle file and tried again.

Resulted in the Gradle output in tkltest_2.4.4_gradle_output_configuration_1a.txt The dependency called out is in the folder identified in app_classpath_file. Then, I thought okay, make a file

2nd Configuration Resulted in the Gradle output in tkltest_2.4.4_gradle_output_configuration_2.txt I don't understand why the Gradle plugin for Java would cause a failure.

Description, continued I also see that there is a statement that module-info.java is not found. Is that a requirement for Tackle-Test?

NOTE: I tried my classpath.txt file with and without "Class-Path:" prepending the dependency declarations.

Any and all help is greatly appreciated. Is there a more detailed guide that I should be following? I don't want to take more of your time than necessary.

Thanks, Todd

Environment information

Attachments Attached - The toml file containing the configuration information used Attached - The log file created by running the CLI with the --verbose and --log-level INFO options Classpath file attached, others not permitted - If possible, a zip file containing the application classes, and the file specified as app_classpath_file option in the toml file together with the library dependencies listed in the file Not generated - If the failure occurred for the generate command, please attach the following files if they were created during the failing run:

classpath.txt tkltest_2.4.4_gradle_output_configuration_1.txt tkltest_2.4.4_gradle_output_configuration_1a.txt tkltest_2.4.4_gradle_output_configuration_2.txt tkltest_unit_configuration_1a.log todd_config.txt

heidenthal-gtisoft commented 1 year ago

I forgot to add that I could not location any of the files identified int the error messages, such as tkltest_get_module_properties_build.gradle or tkltest_get_module_properties_settings.gradle

rachelt44 commented 1 year ago

@heidenthal-gtisoft looks like you're using Gradle 8.0, is that correct? we require Gradle version 7.0 or higher, up to 7.4 (version 7.5 is currently not supported). See prerequisites for more details.

heidenthal-gtisoft commented 1 year ago

@rachelt44 Thanks for the help. I must admit that I missed the version of Gradle in the prerequisites. I will change from the Gradle 7.6.1 I have configured to Gradle 7.4

Just FYI, the message you see regarding Gradle 8.0 in the output files I provided is generated by Gradle to let you know that the Gradle scripts in use are not compatible with Gradle 8.

mmartinGTI commented 1 year ago

I am working with @heidenthal-gtisoft and we have changed the configuration such that we are running Gradle 7.4. The same issue is persisting with the same exception which is highlighted in tkltest_2.4.4_gradle_output_configuration.txt. I have also included my files below which should function identically to the original files in the issue. Once again, any and all help is greatly appreciated.

Environment Information: CLI: 2.4.4 OS: Windows

Outputs and Files: tkltest_2.4.4_gradle_output_configuration.txt config.txt

rachelt44 commented 1 year ago

@mmartinGTI I see that app_classpath_file is set as follows: ['D:\\GTI\\v2024\\GTsuite\\ext\\libs']. It should contain the name of a file in double quotes, and in the file each library dependency is listed in a separate row. See https://github.com/konveyor/tackle-test-generator-cli/blob/main/test/data/daytrader7/tkltest_config.toml for an example how to set app_classpath_file , and https://github.com/konveyor/tackle-test-generator-cli/blob/main/test/data/daytrader7/DayTraderMonoClasspath.txt for an example of the content of an app classpath file. Currently it seems you are pointing app_classpath_file to a list containing a single library. If app_classpath_file is set to the empty string, TackleTest will attempt to extract the dependencies automatically using gradle utilities rather than from the user. Currently since it is set to some value, it is trying to use the given 'libs' array as the classpath file, and consequently failing the build of the application.

rachelt44 commented 1 year ago

@mmartinGTI sorry, my previous comment referred to the previous configurations posted. I see that with the last configuration you progressed to another error. Seems that it is now failing when trying to get modules properties by running a gradle task. The missing plugin it is complaining about should be available for dependency check but it is not.

mmartinGTI commented 1 year ago

@rachelt44 How is tackle-test to be configured when it can not find plugins or libraries that are readily found by the Gradle build scripts? I have tried commenting out this specific plugin just to see if it was causing the problem but the majority of the plugins used are now causing the same issue. I have not changed my configuration since the last post and am not sure what I should change in order to fix this issue. Once again, any and all help is greatly appreciated and thank you for all you have done so far.

rachelt44 commented 1 year ago

@mmartinGTI can you check if the settings.gradle file pointed to in your tackle-test toml configuration contains the missing plugins in the plugin management section? (see for example here)

heidenthal-gtisoft commented 1 year ago

@rachelt44 I have been working to get Tackle Test to work with our build files. At this point, I am wondering if our build.gradle files need to be compliant with 7.6.1 only. Is this the case?

rachelt44 commented 1 year ago

@heidenthal-gtisoft there is no such official requirement but it hasn't been tested with different gradle versions.