requirements job failing on c-c-s causing submission-resources to appear as a skipped test

Bug #1306793 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Resource
Fix Released
High
Daniel Manrique

Bug Description

There's a new job in resources:

id: requirements
estimated_duration: 0.01
plugin: resource
command: [ -f $PLAINBOX_SESSION_SHARE/requirements_docs.txt ] && cat $PLAINBOX_SESSION_SHARE/requirements_docs.txt
_description:
 Provide links to requirements documents.
 .
 Each requirement should have two keys with their respective
 values:
 name: (to be used as the anchor text)
 link: (the actual URL)
 .
 Providers wishing to use this feature need to:
 1- Write a job that places a suitably-formatted file in $PLAINBOX_SESSION_SHARE
 2- Update their whitelists to run that job *before* miscellanea/submission-resources
    or the "requirements" resource job.

and that is a requirement of a new miscellanea job:

plugin: shell
id: miscellanea/submission-resources
depends:
 cpuinfo
 dmi
 dpkg
 lsb
 package
 requirements
 uname
 dmi_attachment
 sysfs_attachment
 udev_attachment
estimated_duration: 1.0
command: true
_description:
    A meta-job depending on the resources needed for a valid submission.

that is appearing as a skipped job because the "requirements" test has failed.

miscellanea/submission-resources test untested job cannot be started: required dependency '2013.com.canonical.certification::requirements' has failed

I get the feeling this is being slurped in because of the new meta job that replaces the resources listing in whitelists, but I'm not familiar with either of these jobs and thus have no idea what they're for or why they exist or why "requirements" is failing on canonical-certification-server.

Maybe not a bug, but maybe it is? I know not.

Tags: bitesize

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :

requirements allows you to insert arbitrary links (name and URL) in the xml report. It was placed in miscellanea/submission-resources to avoid maintaining resources "the old way", with the downside that, as you observed, if the files it depends on are not present, it will barf and cause inconsistent results. This is mostly cosmetic because all the other dependencies of submission-resources will run; and that's the whole point, other than that, we don't really care about submission-resources itself.

For correctness and to avoid confusion, requirements resource should NOT exit with failure if the file it tries to read doesn't exist.

The command for the requirements job is:

command: [ -f $PLAINBOX_SESSION_SHARE/requirements_docs.txt ] && cat $PLAINBOX_SESSION_SHARE/requirements_docs.txt

This can change to:

command: if [ -f $PLAINBOX_SESSION_SHARE/requirements_docs.txt ]; then cat $PLAINBOX_SESSION_SHARE/requirements_docs.txt; else true; fi

Using if/then/else/fi is needed because just adding ||true at the end of the original command will not fail if the file *exists* but is unreadable (if cat blahblah returns error).

Changed in checkbox:
status: New → Invalid
Revision history for this message
Daniel Manrique (roadmr) wrote :

requirements doesn't exist in checkbox, so marking as invalid for that project.

Changed in plainbox-provider-resource:
status: New → Triaged
importance: Undecided → High
tags: added: bitesize
Revision history for this message
Yung Shen (kaxing) wrote :

I've seen this also in default.whitelist, although it does not really failed the submission now as @roadmr mentioned,
prior to the requirement job, would be nice to have another sample job to create example requirements_docs.txt.
Based on description in requirements job, i'm not sure the exactly format it should be.

Revision history for this message
Daniel Manrique (roadmr) wrote :

We can improve the description if you think it'd be easier.

The description says:

Each requirement should have two keys with their respective
 values:
 name: (to be used as the anchor text)
 link: (the actual URL)

So a valid requirements file would be:

name: Yung's home page
link: http://yung.com

name: Sam's home page
link: http://phlin.com

Daniel Manrique (roadmr)
Changed in plainbox-provider-checkbox:
status: New → Invalid
Changed in plainbox-provider-resource:
status: Triaged → In Progress
assignee: nobody → Daniel Manrique (roadmr)
no longer affects: checkbox
no longer affects: plainbox-provider-checkbox
Changed in plainbox-provider-resource:
milestone: none → 0.5
status: In Progress → Fix Committed
Changed in plainbox-provider-resource:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.