Merge ~ines-almeida/launchpad:fetch-service-option-unit-test-fix into launchpad:master

Proposed by Ines Almeida
Status: Merged
Approved by: Ines Almeida
Approved revision: 28d8ddee822897c6265b06fce62d2794b53e1ac5
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ines-almeida/launchpad:fetch-service-option-unit-test-fix
Merge into: launchpad:master
Diff against target: 17 lines (+6/-0)
1 file modified
lib/lp/snappy/browser/tests/test_snap.py (+6/-0)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+462153@code.launchpad.net

Commit message

test: ensure feature flag is ON during test_admin_snap unit test

Description of the change

This was not an issue when the UI MP was created because the `snap.use_fetch_service` was not hidden behind the feature flag.

Since we decided to hide it behind the feature flag in the API MP, this test fails because the feature flag is apparently "OFF" by the end of the test, by some odd reason.

This seems to be specifically a test set up/dependencies issue, that we'll need to look further into.
Currently, this is blocking other work, so my proposition is to simply ensure the feature flag after the browser functions run, and fix the inherent issue as a different task (https://warthogs.atlassian.net/browse/LP-1494).

To post a comment you must log in.
Revision history for this message
Ines Almeida (ines-almeida) wrote :
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py
2index 1127a50..8d2a48a 100644
3--- a/lib/lp/snappy/browser/tests/test_snap.py
4+++ b/lib/lp/snappy/browser/tests/test_snap.py
5@@ -857,6 +857,12 @@ class TestSnapAdminView(BaseTestSnapView):
6 browser.getControl("Use fetch service").selected = True
7 browser.getControl("Update snap package").click()
8
9+ # XXX ines-almeida 2024-03-11: Browser tests work oddly with fixtures.
10+ # This ensures that the feature flag is ON during the rest of the test.
11+ # Further investigation on this issue is required.
12+ self.useFixture(
13+ FeatureFixture({SNAP_USE_FETCH_SERVICE_FEATURE_FLAG: True})
14+ )
15 login_admin()
16 self.assertEqual(project, snap.project)
17 self.assertFalse(snap.require_virtualized)

Subscribers

People subscribed via source and target branches

to status/vote changes: