invalid merge patch#1627
Conversation
| if (before.auth.isDifferentFrom(after.auth)) return false | ||
|
|
||
| // merge-patch bodies are JSON (incl. application/merge-patch+json) | ||
| val bodyParam = patch.parameters.find { it is BodyParam } as BodyParam? |
There was a problem hiding this comment.
here you should explicitly check for application/merge-patch+json or application/json. other formats such as application/json-patch+json would be wrong, and so cannot just use isJson()
| if (!StatusGroup.G_2xx.isInGroup(resPatch.getStatusCode())) return false | ||
| if (!StatusGroup.G_2xx.isInGroup(resAfter.getStatusCode())) return false | ||
|
|
||
| val untouched = extractModifiedFieldNames(patch) - extractSentFieldNames(patch) |
There was a problem hiding this comment.
can add the following comment:
If there are flaky fields, eg, timestamps, there could be a different value between the 2 GETs, regardless of the PATCH. However, we are only looking at the fields of PATCH. it would be weird to set a value with a PATCH that the API can change on a whim... not impossible, but most likely very unlikely. so, in theory field flakiness should not be a problem here
| ) | ||
| if (successPatches.isEmpty()) return@forEach | ||
|
|
||
| for (candidate in successPatches.sortedBy { it.individual.size() }) { |
There was a problem hiding this comment.
are we checking this for every possible candidate? or shouldn't we break as soon as we get one that works?
There was a problem hiding this comment.
@arcuri82 It checks every possible solution. We can return early if we find a fault, if you want, but it can also be valuable to report different combinations of the fault. What do you think?
There was a problem hiding this comment.
are we differentiating these potential different cases in the fitness function using the context for the detected faults? if not, then it is no point, as anyway any other new test would be discarded in archive as not improving fitness
There was a problem hiding this comment.
No, you are right. It will not improve fitness.
| ) | ||
| if (successPatches.isEmpty()) return@forEach | ||
|
|
||
| for (candidate in successPatches.sortedBy { it.individual.size() }) { |
There was a problem hiding this comment.
are we differentiating these potential different cases in the fitness function using the context for the detected faults? if not, then it is no point, as anyway any other new test would be discarded in archive as not improving fitness
…ttp-invalid-merge-patch
Uh oh!
There was an error while loading. Please reload this page.