-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AAP-39137] - Add DAB feature-flags endpoint (#2411)
* Add DAB feature-flags endpoint --------- Co-authored-by: Bruno Rocha <[email protected]>
- Loading branch information
1 parent
e6ed459
commit b525b5f
Showing
13 changed files
with
150 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import pytest | ||
|
||
|
||
@pytest.mark.deployment_standalone | ||
@pytest.mark.min_hub_version("4.10") | ||
@pytest.mark.skipif( | ||
os.getenv("ENABLE_DAB_TESTS"), | ||
reason="Skipping test because ENABLE_DAB_TESTS is set" | ||
) | ||
def test_feature_flags_endpoint_is_exposed(galaxy_client): | ||
""" | ||
We want the download url to point at the gateway | ||
""" | ||
gc = galaxy_client("admin") | ||
flag_url = "feature_flags_state/" | ||
resp = gc.get(flag_url, parse_json=False) | ||
assert resp.status_code == 200 | ||
assert resp.headers.get('Content-Type') == 'application/json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# from django.conf import settings | ||
|
||
# from .base import BaseTestCase, get_current_ui_url | ||
# from django.test import override_settings | ||
|
||
|
||
# class TestUiFeatureFlagsView(BaseTestCase): | ||
# def setUp(self): | ||
# super().setUp() | ||
# self.original_setting = settings.GALAXY_FEATURE_FLAGS | ||
# settings.GALAXY_FEATURE_FLAGS = { | ||
# 'execution_environments': True, | ||
# 'widget_x': False, | ||
# } | ||
|
||
# def tearDown(self): | ||
# super().tearDown() | ||
# settings.GALAXY_FEATURE_FLAGS = self.original_setting | ||
|
||
# def test_feature_flags_dab_api(self): | ||
# response = self.client.get("/feature_flags_definition/") | ||
# assert response.status_code == 200, response.data | ||
# # Test number of feature flags. | ||
# # Modify each time a flag is added to default settings | ||
# assert len(response.data) == 0 | ||
|
||
# @override_settings( | ||
# FLAGS={ | ||
# "FEATURE_SOME_PLATFORM_FLAG_ENABLED": [ | ||
# {"condition": "boolean", "value": False, "required": True}, | ||
# {"condition": "before date", "value": "2022-06-01T12:00Z"}, | ||
# ] | ||
# } | ||
# ) | ||
# @pytest.mark.django_db | ||
# def test_feature_flags_override_flags(admin_client): | ||
# response = admin_client.get(f"{api_url_v1}/feature_flags_definition/") | ||
# assert response.status_code == status.HTTP_200_OK, response.data | ||
# assert len(response.data) == 1 # Validates number of feature flags | ||
# assert ( | ||
# len(response.data["FEATURE_SOME_PLATFORM_FLAG_ENABLED"]) == 2 | ||
# ) # Validates number of conditions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters