Bug 11276

Summary: CI: oe-selftests must have BUILD_ID set
Product: [Yocto Project Subprojects] IoT Reference OS Kit Reporter: Patrick Ohly <patrick.ohly>
Component: intel-iot-refkit-toolsAssignee: Olev Kartau <olev.kartau>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: mikko.ylinen, olev.kartau
Version: unspecified   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 11070, 11071, 11072    

Description Patrick Ohly 2017-03-31 12:40:43 UTC
We are seeing failures in the testing of https://github.com/intel/intel-iot-refkit/pull/97 that look like they are caused by setting BUILD_ID=CI_BUILD_ID only in build.sh, but not the selftest jobs: there's a delay during selftest that implies that some real image building takes place, and the resulting images after that end up having the wrong filename.
Comment 1 Patrick Ohly 2017-04-01 12:46:46 UTC
I've added a fix to https://github.com/intel/intel-iot-refkit/pull/97
Comment 2 Olev Kartau 2017-04-03 07:06:12 UTC
Yes, makes sense to define same BUILD_ID in all CI scripts,
but it's somewhat disturbing that CI tester tries to test
something that gets built in pre/post build stages.
Means, it's probably good that tester failed as it
was clearly trying to test something not built by 
builder script.
Which brings back question, perhaps it is good after all
to have different BUILD_ID used in pre/post scripts,
pointing out overriden builds happening by some side effect,
that we need start investigate.
Comment 3 Olev Kartau 2017-04-03 07:53:59 UTC
I looked more closely to this job log (refkit CI PR build #539).
Based on logs, images existence and timestamps, it seems that
post-build script wiped images that were built by build script,
then built images again with different BUILD_ID.
This is clearly unwanted chain of events,
which was caught thanks to differently set BUILD_ID,
so I dont support idea of this bug title after all,
as same BUILD_ID would make such hiddne wipe-and-replace possible.
Post-build test must not affect build stage result.

We may want to re-think our publishing flow,
which was created before adding pre/post testing.
We publish all result areas in all paths now,
this serves idea that some results/logs are helpful
even after failed/incomplete build stage.

Current flow:
pre-build,build,post-build,publish

Perhaps publish should happen immediately after build phase, to
make sure we publish what we build.
Comment 4 Olev Kartau 2017-04-03 08:23:00 UTC
I overlooked idea that post-build test uses BUILD_ID to select built images,
means my analysis was not entirely correct, and we need it set same way.
But this case still points to publishing problem,
as now there are mixed results from both build and post-build-test stages,
which we publish together.
We should not publish artifacts from post-build-test stage in same location.
If these need publishing, another location should be used.
Comment 5 Olev Kartau 2017-04-03 10:13:13 UTC
PR#100 created, adds BUILD_ID setting, plus restores some cleanroom principles:
- dont keep build/ from after pre-build, 
- publish images right after build phase, so post-build additions dont get out.
Comment 6 Mikko Ylinen 2017-04-04 14:39:03 UTC
PR#100 is merged