Conversation
4fd3b28 to
df3a23f
Compare
Most compiled programs offer a way to output the installed version, usually via arguments like `-v`, or `--version`. This fact can be used to runtime test compiled in a generic way. If the binary prints the compiled version it proves that the program loaded correctly on the specific architecture. While this obviously lacks testing of actual functionallity, it proves a package successfully compiled, installed and loaded related binaries. In cases where no package specific `test.sh` is found, try a variation of common way to print a programs version. Signed-off-by: Paul Spooren <[email protected]>
df3a23f to
5366e19
Compare
|
@jefferyto Here we face the first problem. The It seems to be something like this: |
Signed-off-by: Paul Spooren <[email protected]>
|
I don't want to comment too much on the immediate issue with I suggest something like this (it doesn't need to be all done in one PR), for each package/subpackage:
This way the content of |
|
We expect contributor to be able to fix CI failure, so we need to be able to replicate what the CI does as easily as possible |
|
Sorry this slipped through my notifications.
Please elaborate what parts are too inflexible.
The We could use Makefile
How do you envision this to be implemented? Your host system is unlikely to support all these architectures, likely not even x86-musl. Then you need a working |
| echo "Generic test failed" | ||
| exit 1 | ||
| else | ||
| echo "Test succesful or" |
There was a problem hiding this comment.
Shouldn't this be without or?
| echo "Test succesful or" | |
| echo "Test successful" |
| echo "Test succesful or" | ||
| fi | ||
| else | ||
| echo "No executeable found in package $PKG_NAME" |
There was a problem hiding this comment.
| echo "No executeable found in package $PKG_NAME" | |
| echo "No executable found in package $PKG_NAME" |
|
Tested with lighttpd. Seems OK to me! More tested packages will follow soon. |
|
I'd like to get more input from @champtar and @jefferyto before continuing. |
I agree on this one. We should have something like this.
Because I doubt that anyone wants to create his/her TL;DR: I agree with @jefferyto's suggestions, but one difference that all packages will be using tests even though could be complicated for libraries. |
|
It looks like several members are really depend on run testing packages inside CI/CD, but most of those packages does not have test.sh file at all and it is not run tested in the end. We should proceed with this PR. Any thoughts, @1715173329 , @neheb, @robimarko ? |
| else | ||
| echo "No test.sh script available" | ||
| echo "Use generic test" | ||
| PKG_FILES=$(opkg files "$PKG_NAME" | grep -E "/bin|/sbin|/usr/bin|/usr/sbin") |
There was a problem hiding this comment.
| PKG_FILES=$(opkg files "$PKG_NAME" | grep -E "/bin|/sbin|/usr/bin|/usr/sbin") | |
| PKG_FILES=$(opkg files "$PKG_NAME" | grep -E "/bin|/sbin|/usr/bin|/usr/sbin") |
| for V in --version -version version -v -V; do | ||
| echo "Trying $FILE $V" | ||
| if "$FILE" "$V" 2>&1 | grep "$PKG_VERSION"; then | ||
| SUCCESS=1 | ||
| break | ||
| fi | ||
| done |
There was a problem hiding this comment.
I think ensuring the main binary can display help should be enough for a success already, as a last resort after the version checks. This at least checks that binaries are valid and have the linked dependencies installed.
Also I think it makes sense to do grep -F if that's not the default.
There was a problem hiding this comment.
I think ensuring the main binary can display help should be enough for a success already, as a last resort after the version checks. This at least checks that binaries are valid and have the linked dependencies installed
The problem is how? Because not all packages use exit 0 as a return. Maybe we can use grep to check the binary name itself?
There was a problem hiding this comment.
I meant on top of --version -version version -v -V do something like --help, etc. Worst case scenario somebody's PR fails and they add a proper test.
Might be a good idea to also do an ldd (if it's a binary) and check if any linked dependencies are missing. And do this even if packages have their own tests.
|
I ported this PR to openwrt/actions-shared-workflows#60 since this logic no-longer lives here. Can this be closed? |
Requested via #13589