unit_test: Restore 'waf test' functionality#69
Conversation
.github/workflows/build.yml
Outdated
| - name: Run tests | ||
| run: ./waf test | ||
| continue-on-error: true |
There was a problem hiding this comment.
this will run on each matrix combination, feels like unnecessary. Maybe a new CI workflow for unit tests should be added?
There was a problem hiding this comment.
Agreed. I have split the test runner out into a separate workflow. I also took the opportunity to add a step for uploading the failed visual diff result pngs.
tests/fw/graphics/wscript
Outdated
| # clar(ctx, | ||
| # sources_ant_glob = \ | ||
| # " src/fw/applib/graphics/gtypes.c" \ | ||
| # " src/fw/applib/graphics/graphics_circle.c", | ||
| # test_sources_ant_glob = "test_graphics_circle.c") |
There was a problem hiding this comment.
isn't there a better way to disable a test that doesn't involve commenting out code? like a quarantine list
There was a problem hiding this comment.
I refactored the test skipping into an exclusion list. Good call on this one. The new solution feels a lot cleaner.
tests/fw/comm/wscript
Outdated
| def build(bld): | ||
| # These tests don't compile because the bluetooth library needed was removed. The 'COMM_TESTS_DISABLED' | ||
| # flag has been added to temporarily disabled them. | ||
| if 'COMM_TESTS_DISABLED' in bld.env.DEFINES: |
There was a problem hiding this comment.
This feels like the wrong place to put this flag, since you're not. actually using it in C code. It should be just part of the waf env itself I think?
There was a problem hiding this comment.
Agreed. This specific flag has been replaced by the test exclusion list, but I did add a new flag for skipping the python tool tests. That flag has been added directly to env.
Hexxeh
left a comment
There was a problem hiding this comment.
Can we create tickets for the things we had to disable to remember to go back and fix them?
Sounds like a good idea to me. How do you want to handle this? Should I go ahead make the issues now or after this closes? |
Given they're broken already I think you could go ahead and create them now. Or we could just list them on the original ticket for this. |
|
Created #77 to track the disabled tests |
| pull_request: | ||
| branches: [main] | ||
|
|
||
| env: |
There was a problem hiding this comment.
Is there a way to re-use these between files (same with the first few steps below)?
There was a problem hiding this comment.
I guess it's time to setup a CI Docker image :-)
There was a problem hiding this comment.
How do we feel about making a new issue for that docker image? Outside of my wheel house and seems significant enough to deserve its own review.
tests/wscript
Outdated
| # time_t is defined in sys/types in newlib, and time.h on recent Linux | ||
| # so just force the defined type for testing time | ||
| bld.env.CFLAGS.append('-Dtime_t=__SYSCALL_SLONG_TYPE') | ||
| #bld.env.CFLAGS.append('-Dtime_t=__SYSCALL_SLONG_TYPE') |
There was a problem hiding this comment.
Can this be removed rather than just commenting, if it isn't needed anymore?
gmarull
left a comment
There was a problem hiding this comment.
could you squash changes or reduce diffs somehow? looks like you're undoing initial changes in later commits
5b83a1f to
40306fa
Compare
Done (and done a second time because I found a test I forgot to uncomment and add to BROKEN_TESTS :) ) |
tools/pdc2png/wscript
Outdated
| # time_t is defined in sys/types in newlib, and time.h on recent Linux | ||
| # so just force the defined type for testing time | ||
| pdc2png_env.CFLAGS.append('-Dtime_t=__SYSCALL_SLONG_TYPE') | ||
| #pdc2png_env.CFLAGS.append('-Dtime_t=__SYSCALL_SLONG_TYPE') |
There was a problem hiding this comment.
Can this just be removed (I think this was commented before, was the change maybe just lost)?
There was a problem hiding this comment.
Removed. This is a separate define from the last one. Forgot about it during the last fix.
Signed-off-by: Colin Suckow <colin@suckow.dev>
Restores the
waf testcommand, hopefully resolving #46.Any tests failing to compile were commented out and appended with 'UNIT_TEST_DISABLED' for easy location in the future. Additionally, the entire fw/comm test suite was disabled because of missing bluetooth library headers (GAPAPI.h, GATTAPI.h).
I also added CI steps that run the test suite and parses the output junit.xml file. The test and parse steps are setup to not fail the entire build.