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/lib/tools/store-state: exit on errors, update relevant tests #14725

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

bboozzoo
Copy link
Contributor

Use set -e in the store-state tool to catch errors. Fix failing tests. Update tests/main/store-state to use core22 instead of core for the test snap.

Cherry picked from #14686

@bboozzoo bboozzoo added Simple 😃 A small PR which can be reviewed quickly Run nested The PR also runs tests inluded in nested suite labels Nov 14, 2024
Copy link
Contributor

@zyga zyga left a comment

Choose a reason for hiding this comment

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

LGTM with a question about the developer key. I assume the relevant test is restricted to test-keys build of snapd.

@@ -28,6 +28,8 @@ prepare: |
snap debug can-manage-refreshes | MATCH false

snap ack "$TESTSLIB/assertions/testrootorg-store.account-key"
snap ack "$TESTSLIB/assertions/developer1.account"
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this ack work when we are running non-test keys build (aka a vanilla build)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's if [ "$TRUST_TEST_KEYS" = "false" ]; then above

@@ -1,5 +1,7 @@
#!/bin/bash

set -e
Copy link
Contributor

Choose a reason for hiding this comment

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

Ouch!

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.03%. Comparing base (96ea7b0) to head (222f4a5).
Report is 73 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14725      +/-   ##
==========================================
+ Coverage   78.95%   79.03%   +0.07%     
==========================================
  Files        1084     1087       +3     
  Lines      146638   147628     +990     
==========================================
+ Hits       115773   116671     +898     
- Misses      23667    23728      +61     
- Partials     7198     7229      +31     
Flag Coverage Δ
unittests 79.03% <ø> (+0.07%) ⬆️

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.

Signed-off-by: Maciej Borzecki <[email protected]>

tests/lib/tools/store-state: use gojq

Signed-off-by: Maciej Borzecki <[email protected]>
@bboozzoo bboozzoo force-pushed the bboozzoo/store-state-fixes branch from 0b54bad to c0fe6da Compare November 14, 2024 15:23
Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

The ping is best effort, and is only helpful when later requests will
exercise parts of the API related to lookup of snaps that aren't already
installed. However, in the tests, all relevant dependencies should be
installed beforehand anyway.

Signed-off-by: Maciej Borzecki <[email protected]>
@bboozzoo
Copy link
Contributor Author

Failures:

  • google-core:ubuntu-core-20-64:tests/main/aux-info - unrelated, fluke
  • google:ubuntu-22.04-64:tests/main/snapd-update-services - recurring problem
  • google*:ubuntu--64:tests/main/apparmor-prompting-integration-tests: - known issue(s)
  • google:ubuntu-24.04-64:tests/main/document-interfaces-url - unrelated, known issue

@Meulengracht Meulengracht merged commit ff9d91a into canonical:master Nov 15, 2024
46 of 57 checks passed
@bboozzoo bboozzoo deleted the bboozzoo/store-state-fixes branch November 15, 2024 10:19
sespiros added a commit to sespiros/snapd that referenced this pull request Nov 19, 2024
* master: (44 commits)
  wrappers: do not reload activation units (canonical#14724)
  gadget/install: support for no{exec,dev,suid} mount flags
  interfaces/builtin/mount_control: add support for nfs mounts (canonical#14694)
  tests: use gojq - part 1 (canonical#14686)
  interfaces/desktop-legacy: allow DBus access to com.canonical.dbusmenu
  interfaces/builtin/fwupd.go: allow access to nvmem for thunderbolt plugin
  tests: removing uc16 executions (canonical#14575)
  tests: Added arm github runner to build snapd (canonical#14504)
  tests: no need to run spread when there are not tests matching the filter (canonical#14728)
  tests/lib/tools/store-state: exit on errors, update relevant tests (canonical#14725)
  tests: udpate the github workflow to run tests suggested by spread-filter tool (canonical#14519)
  testtime: add mockable timers for use in tests (canonical#14672)
  interface/screen_inhibit_control: Improve screen inhibit control for use on core (canonical#14134)
  tests: use images with 20G disk in openstack (canonical#14720)
  i/builtin: allow @ in custom-device filepaths (canonical#14651)
  tests: refactor test-snapd-desktop-layout-with-content
  tests: fix broken app definition
  tests: capitalize sentences in comments
  tests: wrap very long shell line
  tests: fix raciness in async startup and sync install
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run nested The PR also runs tests inluded in nested suite Simple 😃 A small PR which can be reviewed quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants