← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Ines Almeida has proposed merging ~ines-almeida/launchpad:fetch-service-option-unit-test-fix into launchpad:master.

Commit message:
test: ensure feature flag is ON during test_admin_snap unit test


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/462153

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).
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:fetch-service-option-unit-test-fix into launchpad:master.
diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py
index 1127a50..8d2a48a 100644
--- a/lib/lp/snappy/browser/tests/test_snap.py
+++ b/lib/lp/snappy/browser/tests/test_snap.py
@@ -857,6 +857,12 @@ class TestSnapAdminView(BaseTestSnapView):
         browser.getControl("Use fetch service").selected = True
         browser.getControl("Update snap package").click()
 
+        # XXX ines-almeida 2024-03-11: Browser tests work oddly with fixtures.
+        # This ensures that the feature flag is ON during the rest of the test.
+        # Further investigation on this issue is required.
+        self.useFixture(
+            FeatureFixture({SNAP_USE_FETCH_SERVICE_FEATURE_FLAG: True})
+        )
         login_admin()
         self.assertEqual(project, snap.project)
         self.assertFalse(snap.require_virtualized)

Follow ups