Skip to content

Forks in python fuzzing and refactoring #2588

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 8 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class PythonCliProcessor(
private val output: String,
private val logger: KLogger,
private val coverageOutput: String?,
private val executionCounterOutput: String?,
) : PythonTestGenerationProcessor() {

override fun saveTests(testsCode: String) {
Expand All @@ -22,9 +23,18 @@ class PythonCliProcessor(
)
}

private fun getExecutionsNumber(testSets: List<PythonTestSet>): Int {
return testSets.sumOf { it.executionsNumber }
}

override fun processCoverageInfo(testSets: List<PythonTestSet>) {
val coverageReport = getStringCoverageInfo(testSets)
val output = coverageOutput ?: return
writeToFileAndSave(output, coverageReport)
coverageOutput?.let { output ->
val coverageReport = getStringCoverageInfo(testSets)
writeToFileAndSave(output, coverageReport)
}
executionCounterOutput?.let { executionOutput ->
val executionReport = "{\"executions\": ${getExecutionsNumber(testSets)}}"
writeToFileAndSave(executionOutput, executionReport)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class PythonGenerateTestsCommand : CliktCommand(
help = "File to write coverage report."
)

private val executionCounterOutput by option(
"--executions-counter",
help = "File to write number of executions."
)

private val installRequirementsIfMissing by option(
"--install-requirements",
help = "Install Python requirements if missing."
Expand Down Expand Up @@ -255,6 +260,7 @@ class PythonGenerateTestsCommand : CliktCommand(
output.toAbsolutePath(),
logger,
coverageOutput?.toAbsolutePath(),
executionCounterOutput?.toAbsolutePath(),
)

logger.info("Loading information about Python types...")
Expand All @@ -270,7 +276,8 @@ class PythonGenerateTestsCommand : CliktCommand(
testSet.executions.filterNot { it.result is UtExecutionSuccess },
testSet.errors,
testSet.mypyReport,
testSet.classId
testSet.classId,
testSet.executionsNumber
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "utbot-executor"
version = "1.4.44"
version = "1.7.0"
description = ""
authors = ["Vyacheslav Tamarin <vyacheslav.tamarin@yandex.ru>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.44
1.7.0

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions utbot-python/samples/cli_utbot_tests/generated_tests__deque.py

This file was deleted.

44 changes: 0 additions & 44 deletions utbot-python/samples/cli_utbot_tests/generated_tests__dicts.py

This file was deleted.

This file was deleted.

This file was deleted.

36 changes: 0 additions & 36 deletions utbot-python/samples/cli_utbot_tests/generated_tests__graph.py

This file was deleted.

Loading