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

tests: tag features collected from debug logs #15091

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maykathm
Copy link
Contributor

This introduces the ability to collect and process logs during spread runs and extract features of interest.

It requires a version of spread that supports both project-level artifacts and the ability to use gzip instead of xz to download the data from core. The relevant PRs for spread are canonical/spread#212 and canonical/spread#213

The following tests are incompatible with the feature tagging and explained in the jira ticket:

  • tests/core/persistent-journal
  • tests/core/persistent-journal-namespace
  • tests/nested/manual/snapd-refresh-from-old
  • tests/nested/manual/preseed
  • tests/nested/manual/core20-install-mode-shutdown-via-hook

Currently, the only "feature" available is a fake feature called "all" that will match all content of all lines. It will get removed in favor of real features.

As an example, here's the command to get the fake "all" feature for the tests/main/ack test:

SPREAD_TAG_FEATURES=all spread -artifacts feature-artifacts google:tests/main/ack

After running, the command, one would then find in the specified feature-artifacts folder:

$ tree feature-artifacts
feature-artifacts/
└── feature-tags
    ├── google:ubuntu-14.04-64:tests_main_ack
    ├── google:ubuntu-16.04-64:tests_main_ack
    ├── google:ubuntu-18.04-64:tests_main_ack
    ├── google:ubuntu-20.04-64:tests_main_ack
    ├── google:ubuntu-secboot-20.04-64:tests_main_ack
    ├── google:ubuntu-22.04-64:tests_main_ack
    ├── google:ubuntu-24.04-64:tests_main_ack
    └── google:ubuntu-24.10-64:tests_main_ack
    ├── google:ubuntu-25.04-64:tests_main_ack

Artifact retrieval for core requires an additional flag:

SPREAD_TAG_FEATURES=all spread -artifacts feature-artifacts -tar-filter gzip google-core:tests/

Copy link

github-actions bot commented Feb 17, 2025

Tue Feb 18 12:47:21 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/13388280788

Failures:

Preparing:

  • google-nested:ubuntu-22.04-64:tests/nested/manual/core20-boot-config-update:gadgetextra
  • google-nested:ubuntu-22.04-64:tests/nested/manual/update-snapd-seed-and-factory-reset:tpm
  • google-nested:ubuntu-22.04-64:tests/nested/manual/core20-fault-inject-on-remodel:gadget_reboot_remodel_boot_assets
  • google-nested:ubuntu-24.04-64:tests/nested/manual/hybrid-remodel

Executing:

  • openstack:fedora-41-64:tests/upgrade/basic
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:partial
  • google-nested:ubuntu-22.04-64:tests/nested/core/core20-fault-inject-on-refresh:base_reboot_auto_connect
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:plain
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller
  • google-nested:ubuntu-22.04-64:tests/nested/manual/recovery-system:tested_and_default
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:encrypted
  • google-nested:ubuntu-22.04-64:tests/nested/manual/recovery-system-offline:untested
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:seeded
  • google-nested:ubuntu-22.04-64:tests/nested/manual/core20-create-recovery
  • google-nested:ubuntu-24.04-64:tests/nested/core/core20-fault-inject-on-refresh:base_reboot_auto_connect
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:plain
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:encrypted
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:seeded
  • google-core:ubuntu-core-18-64:tests/main/security-device-cgroups-self-manage

Restoring:

  • google-nested:ubuntu-22.04-64:tests/nested/manual/core20-boot-config-update:gadgetextra
  • google-nested:ubuntu-22.04-64:tests/nested/manual/
  • google-nested:ubuntu-22.04-64
  • google-nested:ubuntu-22.04-64:tests/nested/manual/update-snapd-seed-and-factory-reset:tpm
  • google-nested:ubuntu-22.04-64:tests/nested/manual/
  • google-nested:ubuntu-22.04-64
  • google-nested:ubuntu-22.04-64:tests/nested/manual/core20-fault-inject-on-remodel:gadget_reboot_remodel_boot_assets
  • google-nested:ubuntu-22.04-64:tests/nested/manual/
  • google-nested:ubuntu-22.04-64

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@1621103). Learn more about missing BASE report.
Report is 234 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #15091   +/-   ##
=========================================
  Coverage          ?   78.06%           
=========================================
  Files             ?     1180           
  Lines             ?   157755           
  Branches          ?        0           
=========================================
  Hits              ?   123157           
  Misses            ?    26948           
  Partials          ?     7650           
Flag Coverage Δ
unittests 78.06% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maykathm maykathm requested a review from bboozzoo February 17, 2025 18:11
@maykathm maykathm force-pushed the SNAPDENG-34442-collect-logs-from-tasks branch from 2b75f48 to 218f9ec Compare February 18, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant