-
Notifications
You must be signed in to change notification settings - Fork 14
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
Run basic hwinfo sanity test on build service #100
Conversation
From the x86 build log
Dmidecode is in the build requires. Maybe |
I see it only in Requires not in BuildRequires. I'll try to add it there but I first want to add the error handling as in the original. |
ah okay. Sounds like a good plan. Thanks |
a4a669b
to
32b6971
Compare
suseconnect-ng.spec
Outdated
@@ -121,7 +130,7 @@ find %_builddir/.. | |||
rm -rf %buildroot/usr/share/go | |||
|
|||
%check | |||
%gotest -v %import_path/internal/connect | |||
%gotest -v %import_path/internal/connect -test-hwinfo |
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.
We were talking about running hwinfo here failing on OBS because it is running as a user, but accessing /dev/mem needs root.
There is a way to give builds access to root, but that needs whitelisting by an obs admin, so we should not use it:
https://github.com/openSUSE/open-build-service/blob/af9297d8d8fb79e14951f657a792474c53179e67/src/backend/BSConfig.pm.template#L220
So, no good way to do tests during rpm build that need root. So if that is the only way then it needs to happen in some other CI, like openqa. The openqa tests are currently run against MicroOS on s390, aarch64 and x86_64.
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.
ok, so maybe the build service should not run with-test-hwinfo
and instead do this test as root on openqa instead. Or maybe there is some env var that can be checked to determine if the tests are running openqa, or maybe we could just skip the hwinfo test if os.Geteuid() != 0
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.
if we add this check, the test will most probably not be run anywhere.
I have another idea: add some macro "flag" in the spec file and make those tests conditional on that. This way we can branch the package, set this flag and get at least the non-root parts executed if needed. These tests have proven useful already and detected missing PPC implementation so I'd rather keep them around at least for manual run.
fb8dd73
to
f0e59c6
Compare
A test flag is added so the build service will run this test on the x86, ARM and s390 builds. The flag is off by default so it does not run on developers machines.
f0e59c6
to
c007f55
Compare
suseconnect-ng.spec
Outdated
@@ -121,7 +130,7 @@ find %_builddir/.. | |||
rm -rf %buildroot/usr/share/go | |||
|
|||
%check | |||
%gotest -v %import_path/internal/connect | |||
%gotest -v %import_path/internal/connect -test-hwinfo |
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.
ok, so maybe the build service should not run with-test-hwinfo
and instead do this test as root on openqa instead. Or maybe there is some env var that can be checked to determine if the tests are running openqa, or maybe we could just skip the hwinfo test if os.Geteuid() != 0
6eb8166
to
75b0dd1
Compare
76aca4a
to
3240dbb
Compare
3240dbb
to
c547146
Compare
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.
LGTM - but I'm not allowed to approve because I started the PR.
@JanZerebecki can you take a quick look at the spec file changes? |
I don't have time to look at it in detail, you will need to proceed without me. There are people outside of our team who have knowledge of openqa who you can contact, e.g. Jose username jlausuch on Github. |
@JanZerebecki thx! |
A test flag is added so the build service will run this test on
the x86, ARM and s390 builds. The flag is off by default so it does
not run on developers machines.