Skip to content

Make tests more portable#916

Open
twz123 wants to merge 5 commits intorunmedev:mainfrom
twz123:more-portable-tests
Open

Make tests more portable#916
twz123 wants to merge 5 commits intorunmedev:mainfrom
twz123:more-portable-tests

Conversation

@twz123
Copy link
Contributor

@twz123 twz123 commented Sep 18, 2025

  • Fix tests that call commands without a proper PATH
    Prefix all calls to executables with /usr/bin/env, or replace them with shell builtins. Use an absolute path when dumping the env.
  • Only source cargo env if the file exists
    This allows for the tests to succeed, even if there's no such file on the local system.
  • Remove the hardcoded SHELL variables
    It's usually not required to set this at all, except for rare occasions. There are systems out there which don't have a shell/bash in /bin/bash.
  • Don't rely on /usr/local
    Use standard paths, instead.

This removes the necessity for env being in the path when executing
scripts.

Signed-off-by: Tom Wieczorek <tom@bibbu.net>
This allows for the tests to succeed, even if there's no such file on
the local system.

Signed-off-by: Tom Wieczorek <tom@bibbu.net>
It's usually not required to set this at all, except for rare occasions.
There are systems out there which don't have a shell/bash in /bin/bash.

Signed-off-by: Tom Wieczorek <tom@bibbu.net>
Prefix all calls to executables with /usr/bin/env, or replace them with
shell builtins.

Signed-off-by: Tom Wieczorek <tom@bibbu.net>
Use standard paths, instead.

Signed-off-by: Tom Wieczorek <tom@bibbu.net>
@sourishkrout
Copy link
Contributor

@twz123 thank you! Please see my extra commit as part of #919. We need to support both BSD and GNU utilities in the test suite.

@sourishkrout sourishkrout self-requested a review September 19, 2025 20:15
Copy link
Contributor

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending BSD/GNU compatibility fix here we can merge this.

It appears tests are failing on Windows now, too. We need to fix this, please.

LABEL org.opencontainers.image.description="An image to build and test runme."

ENV HOME=/root
ENV SHELL=/bin/bash
Copy link
Contributor

@sourishkrout sourishkrout Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this Dagger builds will fail. This might very well be an issue in the underlying container image. However, it deserves its own PR to address this because without it downstream pipelines will fail to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants