-
Notifications
You must be signed in to change notification settings - Fork 23
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
[ICTL-908] Test Compiler for Kotlin #282
[ICTL-908] Test Compiler for Kotlin #282
Conversation
…hub.com/JetBrains-Research/TestSpark into ebraun/improvements/compiler-for-kotlin
…braun/improvements/compiler-for-kotlin
…braun/improvements/parsing-llm-response
core/src/main/kotlin/org/jetbrains/research/testspark/core/test/TestsPersistentStorage.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/org/jetbrains/research/testspark/core/test/java/JavaJUnitTestSuiteParser.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/org/jetbrains/research/testspark/core/test/java/JavaJUnitTestSuiteParser.kt
Show resolved
Hide resolved
.../main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinJUnitTestSuiteParser.kt
Outdated
Show resolved
Hide resolved
core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt
Show resolved
Hide resolved
src/main/kotlin/org/jetbrains/research/testspark/tools/llm/generation/openai/.grazie.en.yaml
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/jetbrains/research/testspark/tools/llm/test/JUnitTestSuitePresenter.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/jetbrains/research/testspark/tools/llm/test/JUnitTestSuitePresenter.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/jetbrains/research/testspark/tools/llm/test/JUnitTestSuitePresenter.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/jetbrains/research/testspark/tools/strategies/TestProcessorStrategies.kt
Outdated
Show resolved
Hide resolved
Some changes raised from the review of this PR will be addressed in: |
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.
Great that you added some tests! All fine!
I added a small comment about refactoring (about replacing single-method factories with static factory methods inside the base classes). It can be dedicated to another PR.
core/src/main/kotlin/org/jetbrains/research/testspark/core/test/TestsPersistentStorage.kt
Outdated
Show resolved
Hide resolved
class TestBodyPrinterFactory { | ||
companion object { | ||
fun createTestBodyPrinter(language: SupportedLanguage): TestBodyPrinter { | ||
return when (language) { | ||
SupportedLanguage.Kotlin -> KotlinTestBodyPrinter() | ||
SupportedLanguage.Java -> JavaTestBodyPrinter() | ||
} | ||
} | ||
} | ||
} |
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.
[Thinking out load here; not for this PR but worth investing effort at]:
Every [Something]Factory
class that we have often contains a single method create[Something](language)
. We can turn the Factory Pattern into the Factory Method Pattern.
These create[Something]()
static methods can be moved into the base abstract classes/interfaces (e.g., in this case we can place createTestBodyPrinter()
static method into TestBodyPrinter
interface (and maybe rename to just create()
). This will allow us to remove a single entity from the codebase, namely TestBodyPrinterFactory
. It'll reduce the code complexity.
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.
Addressed in #305
class TestCompilerFactory { | ||
companion object { | ||
fun createJavacTestCompiler( | ||
fun createTestCompiler( | ||
project: Project, | ||
junitVersion: JUnitVersion, |
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.
We can also turn this factory into a factory method within the TestCompiler
interface.
class TestSuiteParserFactory { | ||
companion object { | ||
fun createJUnitTestSuiteParser( | ||
jUnitVersion: JUnitVersion, |
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.
This one can also be turned into a factory method.
Description of changes made
Detailed PR explanation can be found in https://youtrack.jetbrains.com/issue/ICTL-908/Test-Compiler-for-Kotlin
Partially solves the following issue #295
TestAssempler
diagramWhy is merge request needed
This is the last step for Kotlin support.
Other notes
Closes #ICTL908
What is missing?
Probably, there are some bugs in the whole implementation. They will be fixed during the review or while testing the TestSpark using TestSpark.