-
Notifications
You must be signed in to change notification settings - Fork 21
multi-arch-test-build: add generic package tests #60
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
base: main
Are you sure you want to change the base?
multi-arch-test-build: add generic package tests #60
Conversation
d9a5fd2 to
919e360
Compare
99db061 to
22e2dc6
Compare
22e2dc6 to
ef0a278
Compare
|
@Ansuel what do you think about this? :) |
ef0a278 to
fa95e6a
Compare
|
And it looks like @cotequeiroz might be interested in this as well as he fiddles with CI test in openwrt/packages#27867 |
|
News travel fast here. You can say I'm a big fan of this. |
fa95e6a to
12b3785
Compare
12b3785 to
0dc230a
Compare
|
I've reworked the script and added more executable and library checks:
I suppose there could be either a per-feed and/or a per-package switch whether these tests should run. Potentially on top of the package-specific tests. |
0dc230a to
09baac7
Compare
09baac7 to
ec3b743
Compare
d96f4df to
c66b035
Compare
Use same path structure to other workflows for Dockerfile and script. Add ci_helpers through the Dockerfile. Change CI_HELPER to CI_HELPERS Remove unused volume. Signed-off-by: George Sapkin <[email protected]>
Check if any of the package executables return the expected version when called with a generic list of flags, e.g. --version, -v, etc. Check if executable and library symlinks are valid. Check if executables are marked as such. Check for hardcoded paths. Check if binaries are stripped. Check if all shared linked libraries are installed. Check if libraries have sonames and if so, if they have a soname symlink. Generic tests are both enabled and forced by default, i.e. they will run even if a package-specific test is present. Signed-off-by: George Sapkin <[email protected]>
c66b035 to
462d26a
Compare
|
Whoa, looks like it's ready and just needs merging, right? Review would be nice, but no one’s touched it in a month. It’d be awesome to get this merged, I could really use it right now. |
| export PKG_NAME PKG_VERSION CI_HELPERS | ||
|
|
||
| if [ -f "$PRE_TEST_SCRIPT" ]; then | ||
| info 'Use the package-specific pre-test.sh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| info 'Use the package-specific pre-test.sh' | |
| info 'Running package-specific pre-test script' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above regarding string phrasing. I don't have a strong feeling about these though.
| SUCCESS=0 | ||
|
|
||
| if generic_tests_enabled && ( generic_tests_forced || [ ! -f "$TEST_SCRIPT" ] ); then | ||
| warn 'Use generic tests' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| warn 'Use generic tests' | |
| warn 'Running generic tests' |
| fi | ||
|
|
||
| if [ -f "$TEST_SCRIPT" ]; then | ||
| info 'Use the package-specific test.sh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| info 'Use the package-specific test.sh' | |
| info 'Using the package-specific test.sh' |
| mkdir -p /var/lock/ | ||
| mkdir -p /var/log/ | ||
|
|
||
| CI_HELPERS="${CI_HELPERS:-/scripts/ci_helpers.sh}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add something like this?
if [ ! -f "$CI_HELPERS" ]; then
echo "ERROR: CI helpers file not found: $CI_HELPERS" >&2
exit 1
fi
|
|
||
| for PKG in /ci/*.[ai]pk; do | ||
| if is_opkg; then | ||
| tar -xzOf "$PKG" ./control.tar.gz | tar xzf - ./control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if tar fails to extract it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the script is from before. GH UI for some reason doesn't show that this file was moved. So I didn't modify anything unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... yeah, it is quite confusing. :-/ Would be easier to review things, which we can see what you modified/added/changed, but I will prepare PR against your repo.
Add generic version tests based on openwrt/packages#13589 and openwrt/packages#13785.
When a package-specific test is not present:
Unify Dockerfile and script paths.
Add ci_helpers through the Dockerfile.
Change
CI_HELPERtoCI_HELPERS. This doesn't seem to be used anywhere outside of this repo at the moment.Remove unused
dockerfiles_feedsand helper volumes.Sample output:
Note
Doesn't address the
xxdissue (i.e. the test fails) where the binary has a different version from the package.This can be addressed either by adding a package-specific test or setting a sub-package version.
Example main/apk job: https://github.com/GeorgeSapkin/openwrt-packages/actions/runs/19636812537/job/56229491345?pr=12#step:17:54
I took the liberty to improve the readability of the script a bit.
CC: @aparcar, @BKPepe, @wehagy