-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
test: reducing logspam #5022
test: reducing logspam #5022
Conversation
3d86d4c
to
9bca6ef
Compare
In this branch's current state, things work fine for engine-tests. If you look at the console output for the and when you look at the output for a specific test, you see it has some: https://jenkins.terasology.io/teraorg/job/Terasology/job/engine/view/change-requests/job/PR-5022/2/testReport/org.terasology.engine.integrationenvironment/MTEExtensionTestWithPerClassLifecycle/Integration_Tests___firstTestFindsThings__/ (The The thing I haven't checked yet, and I expect is not filtered, is the output of module tests. |
Things to know about junit and logging: JUnit uses |
We only use xml for configs and it's just extra noise.
Excludes - reflections "given scan urls are empty": wontfix - reflections errors on benchmark classes: wontfix, engine doesn't need to Reflect on them - engine.i18n info-level messages: rarely relevant to test execution
So when Jenkins truncates the part you wanted to see, you can get download the whole thing and look at it locally. build(jenkins): include the default logback.xml in artifacts So the module build job can pick it up if the module didn't bring their own.
Goals: - Only the edges (facade, test runners) should define a logging backend (logback) - except the code that uses specific logback classes (and maybe that should be only logback-core, but that's another story) - All test tasks should be able to filter logs with logback - Test frameworks like JUnit should be `test*` dependencies - except code in engine-tests/src/main that builds on JUnit APIs for use by external module tests
Easier to use and much lighter requirements than Janino or Groovy.
…ce shipped with engine
and add some comments for documentation
installed by `groovyw module refresh`
5020499
to
c670b39
Compare
# Conflicts: # engine-tests/build.gradle # engine/build.gradle
I've never been happy with the
setupLogging
method I added to MTE. Now that it's a year later and we no longer have the engine-tests/MTE split to worry about, I might understand things well enough to do better.Contains
A logback configuration file to be used by default during module tests. Run
groovyw module refresh
to add thislogback-test.xml
to your workspace.A new syntax to exclude log messages using a regular expression.
[ example filter configuration, before and after ]
Before, using logback-classic matchers as documented:
After:
Terasology/engine/src/main/resources/org/terasology/engine/logback/filter-reflections.xml
Line 8 in de1c104
Implementation Goals:
test*
dependencies.api
if classes/interfaces from it show up on public method signatures.implementation
if it's needed to compile but not publicly visible.logback.xml
a downstream consumer wants to set up.How to test
Run some engine tests, run some module tests, see if you can figure out how to include or exclude the log messages you want during your test output.
Outstanding before merging
Include with Merge