Skip to content
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

ci: yocto-check-layer: set BSP machines to be tested #80

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

ndechesne
Copy link
Contributor

When running yocto-check-layer, we can see the following logs:

INFO: test_machine_signatures (bsp.BSPCheckLayer)
INFO: ... skipped 'No machines set with --machines.'
INFO: No machines set with --machines.
INFO: test_machine_world (bsp.BSPCheckLayer)
INFO: ... skipped 'No machines set with --machines.'
INFO: No machines set with --machines.

Because we do not set --machines when running the script, it does not try to run the tests with each individual machine. When setting machines, yocto-check-layer will ensure that all signatures do not change when setting MACHINE for each our supported machine. So we can catch more errors. Note that this is also what would be done by Yocto if we wanted to run the compliance tests.

E.g. from Yocto docs:

bsp.test_machine_world: Verifies that bitbake world works regardless
of which machine is selected.

bsp.test_machine_signatures: Verifies that building for a particular
machine affects only the signature of
tasks specific to that machine.

Copy link
Contributor

@quaresmajose quaresmajose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

When running yocto-check-layer, we can see the following logs:

INFO: test_machine_signatures (bsp.BSPCheckLayer)
INFO:  ... skipped 'No machines set with --machines.'
INFO: No machines set with --machines.
INFO: test_machine_world (bsp.BSPCheckLayer)
INFO:  ... skipped 'No machines set with --machines.'
INFO: No machines set with --machines.

Because we do not set --machines when running the script, it does not
try to run the tests with each individual machine. When setting
machines, yocto-check-layer will ensure that all signatures do not
change when setting MACHINE for each our supported machine. So we can
catch more errors. Note that this is also what would be done by Yocto
if we wanted to run the compliance tests.

E.g. from Yocto docs:

bsp.test_machine_world: Verifies that bitbake world works regardless
                        of which machine is selected.

bsp.test_machine_signatures: Verifies that building for a particular
                             machine affects only the signature of
                             tasks specific to that machine.

Signed-off-by: Nicolas Dechesne <[email protected]>
In the Github actions for yocto-check-layer, we can see the following
error:

INFO: Traceback (most recent call last):
  File "/opt/actions-runner/_work/meta-qcom-hwe/meta-qcom-hwe/poky/scripts/lib/checklayer/cases/common.py", line 87, in test_patches_upstream_status
    self.assertEqual(len(patches), 0 , \
AssertionError: 1 != 0 : Found following patches with malformed or missing upstream status:
/opt/actions-runner/_work/meta-qcom-hwe/meta-qcom-hwe/poky/meta/lib/oeqa/manual/abat.patch

Since KAS_WORK_DIR is not set, and since kas is executed from inside
the repo, we end up cloning poky and meta-qcom inside meta-qcom-hwe
repo. As such yocto-check-layer will 'parse' the entire poky (and
meta-qcom) repo , especially when looking for .patch files. Arguably
yocto-check-layer could be smarter and skip .patch files not
referenced in a valid recipe.. but it's not the case.

So we need to ensure that we checkout the kas workspace outside of our
repo. With this patch we either let the caller manage KAS_WORK_DIR, or
we create a temporary directory ourselves (typically in Github Actions).

This patch fixes the error mentioned above.

Signed-off-by: Nicolas Dechesne <[email protected]>
quaresmajose

This comment was marked as outdated.

@quaresmajose
Copy link
Contributor

we need to set the KAS_WORK_DIR and create it on the github action job

export KAS_WORK_DIR=$PWD/../kas
mkdir $KAS_WORK_DIR

@quaresmajose quaresmajose self-requested a review November 19, 2024 17:30
@ndechesne
Copy link
Contributor Author

we need to set the KAS_WORK_DIR and create it on the github action job

export KAS_WORK_DIR=$PWD/../kas
mkdir $KAS_WORK_DIR

We can indeed, but it's not strictly needed. especially for yocto-check-layer and yocto-patchreview, we don't build anything, so using the temp folder in /tmp is ok, it is thrown away when the job is done anyway. So can we merge this PR (and the one about patchreview) first, and then we can decide if we want to set KAS_WORK_DIR globally for all jobs in build-yocto workflow? does that work for you?

@quaresmajose
Copy link
Contributor

Another thing I see we are not using here is the KAS_REPO_REF_DIR which already contains the repositories.
But I agree in merging this and do some follow-up to refactor the use of the KAS_WORK_DIR and the KAS_REPO_REF_DIR globally.

Copy link
Contributor

@quaresmajose quaresmajose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ricardosalveti ricardosalveti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ricardosalveti ricardosalveti merged commit 0549425 into qualcomm-linux:main Nov 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants