Skip to content
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

Split files #135

Merged
merged 14 commits into from Jan 11, 2020
Merged

Split files #135

merged 14 commits into from Jan 11, 2020

Conversation

@bogdanmarculescu
Copy link
Contributor

bogdanmarculescu commented Dec 3, 2019

Seems to work.
Tried it on available case-studies, and have spotted no new problems introduced.

Plus minor tweak to avoid writing host:port messages (since they can
and do cause brittleness).
@@ -103,6 +103,7 @@ class ExpectationsWriter {
if (printableElement != "null"
&& printableElement != TestCaseWriter.NOT_COVERED_YET
&& !printableTh.contains("logged")
&& !printableTh.contains("""\w+:\d{4,5}""".toRegex())
) {

This comment has been minimized.

Copy link
@arcuri82

arcuri82 Dec 6, 2019

Collaborator

can u add a comment to describe what this for?

@@ -650,6 +651,7 @@ class TestCaseWriter {
if (printableTh != "null"
&& printableTh != NOT_COVERED_YET
&& !printableTh.contains("logged")
&& !printableTh.contains("""\w+:\d{4,5}""".toRegex())
) {

This comment has been minimized.

Copy link
@arcuri82

arcuri82 Dec 6, 2019

Collaborator

you are repeating the same regular expression several times. put it to a final constant variable

}
}

fun <T:Individual> splitByCode(solution: Solution<T>): List<Solution<T>>{

This comment has been minimized.

Copy link
@arcuri82

arcuri82 Dec 6, 2019

Collaborator

clarify it is HTTP codes

val s500 = solution.individuals.filter {
it.evaluatedActions().any { ac ->
(ac.result as RestCallResult).getStatusCode() == 500

This comment has been minimized.

Copy link
@arcuri82

arcuri82 Dec 6, 2019

Collaborator

clarify in a comment that here we just look at 500, and not at all the 5xx (eg, 501), as those are not so interesting (eg, not really related to find bugs)

@@ -14,6 +14,7 @@ class ExpectationsWriter {
private val responseStructureOracle = "responseStructureOracle"
private lateinit var swagger: Swagger
private lateinit var partialOracles: PartialOracles
private val portRegex = """\w+:\d{4,5}""".toRegex()

This comment has been minimized.

Copy link
@arcuri82

arcuri82 Dec 6, 2019

Collaborator

this would not catch localhost:80 for example. i guess {1,5} would be better

and what about 127.0.0.1:8080? that would not be considered.

i guess could have something like: (\w+|(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})):\d{1,5}

This comment has been minimized.

Copy link
@bogdanmarculescu

bogdanmarculescu Dec 6, 2019

Author Contributor

Agreed. Although I'm still hoping to think of a better and more long-term solution than this.

being present in error messages.
@bogdanmarculescu bogdanmarculescu requested a review from arcuri82 Dec 10, 2019
@arcuri82

This comment has been minimized.

Copy link
Collaborator

arcuri82 commented Dec 10, 2019

Hi,
can you add some E2E tests for the CODE option? (I thought I wrote it in a comment somewhere last time, but I do not see it anymore)

where the search results in several files.

Currently part of the splitter test, but to be migrated to RestTestBase.

A lighter cleanCompiledFiles is added (as compiling several files
without cleanup between them appears to cause problems).
Still not ideal, but appears to work.
*/

solutions.filter { !it.individuals.isNullOrEmpty() }.map {
writer.writeTests(it, controllerInfoDto?.fullName)

This comment has been minimized.

Copy link
@arcuri82

arcuri82 Dec 26, 2019

Collaborator

that's weird. why a map instead of a forEach?
furthermore, for readability, the .forEach{ would be best on next line instead of being
on same line as .filter{

This comment has been minimized.

Copy link
@bogdanmarculescu

bogdanmarculescu Jan 10, 2020

Author Contributor

Just pushed a fix for it. It was mostly a leftover from a previous version.

@arcuri82

This comment has been minimized.

Copy link
Collaborator

arcuri82 commented Jan 10, 2020

Hi,
build fails. As EMConfig is modified, you need to do a rebase/merge, and recreate the .md documentation file

@bogdanmarculescu

This comment has been minimized.

Copy link
Contributor Author

bogdanmarculescu commented Jan 10, 2020

Damn. Did the merge for the other branch, forgot about this one. Fixed. Sorry!

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 10, 2020

Codecov Report

Merging #135 into master will decrease coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #135      +/-   ##
============================================
- Coverage     53.68%   53.61%   -0.07%     
  Complexity       11       11              
============================================
  Files           495      495              
  Lines         17839    17839              
  Branches       3449     3449              
============================================
- Hits           9576     9564      -12     
- Misses         6997     7016      +19     
+ Partials       1266     1259       -7
Impacted Files Coverage Δ Complexity Δ
...er/core/search/algorithms/wts/WtsEvalIndividual.kt 12.5% <0%> (-62.5%) 0% <0%> (ø)
...g/evomaster/core/search/algorithms/WtsAlgorithm.kt 26.08% <0%> (-59.43%) 0% <0%> (ø)
...n/kotlin/org/evomaster/core/taint/TaintAnalysis.kt 85.89% <0%> (-1.29%) 0% <0%> (ø)
...otlin/org/evomaster/core/search/gene/StringGene.kt 62.84% <0%> (+0.79%) 0% <0%> (ø) ⬇️
...r/core/problem/rest/service/AbstractRestFitness.kt 57.14% <0%> (+1.73%) 0% <0%> (ø) ⬇️
.../evomaster/core/remote/service/RemoteController.kt 66.45% <0%> (+8.22%) 0% <0%> (ø) ⬇️
...evomaster/core/problem/rest/service/RestFitness.kt 87.71% <0%> (+8.77%) 0% <0%> (ø) ⬇️
...g/evomaster/core/search/service/FitnessFunction.kt 72% <0%> (+20%) 0% <0%> (ø) ⬇️
...in/org/evomaster/core/logging/UniqueTurboFilter.kt 80% <0%> (+40%) 0% <0%> (ø) ⬇️
...n/kotlin/org/evomaster/core/logging/LoggingUtil.kt 60% <0%> (+40%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2949525...329cfbc. Read the comment docs.

@arcuri82 arcuri82 merged commit 35175d7 into master Jan 11, 2020
4 of 5 checks passed
4 of 5 checks passed
codecov/project 53.61% (-0.07%) compared to 2949525
Details
ci/circleci: build Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing 2949525...329cfbc
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.