Skip to content

build system: Allow running tests in docker#21752

Merged
crasbe merged 1 commit intoRIOT-OS:masterfrom
maribu:docker/run-test-on-native-in-docker
Sep 30, 2025
Merged

build system: Allow running tests in docker#21752
crasbe merged 1 commit intoRIOT-OS:masterfrom
maribu:docker/run-test-on-native-in-docker

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented Sep 30, 2025

Contribution description

When building for native with BUILD_IN_DOCKER=1, the created elf file may not be compatible with the host system if:

  • The container used is using glibc and the host system is using another C lib
  • Both container and host are using glibc, but the container is using a more recent one than the host

To avoid these issues, this commit changes behavior to just run the test goal inside the docker image as well when the board is native%.

Testing procedure

Run the following commands:

  1. make -C tests/sys/fmt_print all test BOARD=native64 BUILD_IN_DOCKER=1
    • Build should be run in docker
    • Test should be run in docker
  2. make -C tests/sys/fmt_print all test BOARD=native BUILD_IN_DOCKER=1
    • Build should be run in docker
    • Test should be run in docker
  3. make -C tests/sys/fmt_print all test BOARD=native64
    • Build should NOT be run in docker
    • Test should NOT be run in docker
  4. make -C tests/sys/fmt_print all test BOARD=samr21-xpro
    • Build should NOT be run in docker
    • Test should NOT be run in docker
  5. make -C tests/sys/fmt_print all test BOARD=samr21-xpro BUILD_IN_DOCKER=1
    • Build should be run in docker
    • Test should NOT be run in docker

Issues/PRs references

None

When building for native with `BUILD_IN_DOCKER=1`, the created elf file
may not be compatible with the host system if:

- The container used is using glibc and the host system is using another
  C lib
- Both container and host are using glibc, but the container is using
  a more recent one than the host

To avoid these issues, this commit changes behavior to just run the `test`
goal inside the docker image as well when the board is `native%`.
@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 30, 2025
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Sep 30, 2025
@riot-ci
Copy link
Copy Markdown

riot-ci commented Sep 30, 2025

Murdock results

✔️ PASSED

651e190 build system: Allow running tests in docker

Success Failures Total Runtime
10516 0 10516 11m:07s

Artifacts

@crasbe crasbe added this pull request to the merge queue Sep 30, 2025
Merged via the queue into RIOT-OS:master with commit 868a533 Sep 30, 2025
29 checks passed
@maribu
Copy link
Copy Markdown
Member Author

maribu commented Oct 1, 2025

Thx ❤️

@maribu maribu deleted the docker/run-test-on-native-in-docker branch October 1, 2025 03:47
@mguetschow
Copy link
Copy Markdown
Contributor

On my system, commit 651e190 and current master,

make -C tests/sys/fmt_print all test BOARD=native64

  • Build should NOT be run in docker
  • Test should NOT be run in docker

first builds the application locally, then again inside docker and also runs the test inside docker. I think this regression should be fixed before the next release @benpicco.

maribu added a commit to maribu/RIOT that referenced this pull request Oct 14, 2025
@maribu
Copy link
Copy Markdown
Member Author

maribu commented Oct 14, 2025

I can reproduce the issue. I could have sworn it worked as expected when I tested it two weeks ago.

See #21793 for the fix.

github-merge-queue bot pushed a commit that referenced this pull request Oct 14, 2025
…cker-fixup

build system: Fix regression from #21752
@benpicco benpicco added this to the Release 2025.10 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants