DOCKER-464 Added json logging test#222
Conversation
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
2repository/build.gradle
Outdated
| systemProperty 'alfresco.port.internal', '8080' | ||
| systemProperty 'flavor', "${project.alfresco.flavor}" | ||
| systemProperty 'version', "${project.alfresco.version.major}" + "." + "${project.alfresco.version.minor}" | ||
| systemProperty('alfresco_image_name', "${calcRepository(project.alfresco.flavor,true)}:${calcTags(project.alfresco.version).last()}") |
There was a problem hiding this comment.
Store the image name in a variable and use it in 2 places instead of duplicating the logic.
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
| return result; | ||
| } | ||
|
|
||
| private boolean isCorrectJsonLogs(String logs) { |
There was a problem hiding this comment.
This is not checking if the logs are correct json. Why don't you just json parse every line?
There was a problem hiding this comment.
I didn't feel the need to test if the log line was actual valid JSON, because this would mean that the logging provider would've returned broken logging. So to keep it simple just checking the presence of the required keys seemed enough. I'll change it to use JSON parsing.
There was a problem hiding this comment.
Maybe I'm nitpicking here, but we are still not testing if it valid JSON. We only test the first line that contains "type": "application".
Also, if this returns false, it does not have to mean that JSON_LOGGING was correctly set to false.
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
thijslemmens
left a comment
There was a problem hiding this comment.
I would avoid the Thread.sleep and use Awaitility instead. That way you can wait until you have x amount of logs.
Signed-off-by: Tim-Lukas Blom <tim-lukas.blom@xenit.eu>
Added integration tests that check if the logging in the alfresco container is JSON logging and contains the required fields.
Currently only checks the logs of type application. Access and SQL logs are not included in the test.