Skip to content

Commit

Permalink
Move hidden Fusion check to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kesmit13 committed Sep 3, 2024
1 parent ea9644b commit 8b0d473
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
SINGLESTOREDB_PURE_PYTHON: 0
SINGLESTORE_LICENSE: ${{ secrets.SINGLESTORE_LICENSE }}
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }}
SINGLESTOREDB_FUSION_ENABLE_HIDDEN: "1"

- name: Run MySQL protocol tests (pure Python)
run: |
Expand All @@ -61,6 +62,7 @@ jobs:
SINGLESTOREDB_PURE_PYTHON: 1
SINGLESTORE_LICENSE: ${{ secrets.SINGLESTORE_LICENSE }}
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }}
SINGLESTOREDB_FUSION_ENABLE_HIDDEN: "1"

- name: Run HTTP protocol tests
run: |
Expand All @@ -74,6 +76,7 @@ jobs:
# used to create the database and the generated database name will
# be applied to the above URL.
SINGLESTOREDB_INIT_DB_URL: "root:[email protected]:3307"
SINGLESTOREDB_FUSION_ENABLE_HIDDEN: "1"

- name: Generate report
run: |
Expand Down
25 changes: 4 additions & 21 deletions singlestoredb/tests/test_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def tearDownClass(cls):
def setUp(self):
self.enabled = os.environ.get('SINGLESTOREDB_FUSION_ENABLED')
os.environ['SINGLESTOREDB_FUSION_ENABLED'] = '1'
self.hidden_enabled = os.environ.get('SINGLESTOREDB_FUSION_ENABLE_HIDDEN')
os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN'] = '1'
self.conn = s2.connect(database=type(self).dbname, local_infile=True)
self.cur = self.conn.cursor()

Expand All @@ -44,11 +42,6 @@ def tearDown(self):
else:
del os.environ['SINGLESTOREDB_FUSION_ENABLED']

if self.hidden_enabled:
os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN'] = self.hidden_enabled
else:
del os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN']

try:
if self.cur is not None:
self.cur.close()
Expand Down Expand Up @@ -141,8 +134,6 @@ def tearDownClass(cls):
def setUp(self):
self.enabled = os.environ.get('SINGLESTOREDB_FUSION_ENABLED')
os.environ['SINGLESTOREDB_FUSION_ENABLED'] = '1'
self.hidden_enabled = os.environ.get('SINGLESTOREDB_FUSION_ENABLE_HIDDEN')
os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN'] = '1'
self.conn = s2.connect(database=type(self).dbname, local_infile=True)
self.cur = self.conn.cursor()

Expand All @@ -152,11 +143,6 @@ def tearDown(self):
else:
del os.environ['SINGLESTOREDB_FUSION_ENABLED']

if self.hidden_enabled:
os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN'] = self.hidden_enabled
else:
del os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN']

try:
if self.cur is not None:
self.cur.close()
Expand Down Expand Up @@ -479,6 +465,10 @@ def test_create_drop_workspace_group(self):
pass


@unittest.skipIf(
os.environ.get('SINGLESTOREDB_FUSION_ENABLE_HIDDEN', '0') == '0',
'Hidden Fusion commands are not enabled.',
)
@pytest.mark.management
class TestJobsFusion(unittest.TestCase):

Expand Down Expand Up @@ -526,8 +516,6 @@ def tearDownClass(cls):
def setUp(self):
self.enabled = os.environ.get('SINGLESTOREDB_FUSION_ENABLED')
os.environ['SINGLESTOREDB_FUSION_ENABLED'] = '1'
self.hidden_enabled = os.environ.get('SINGLESTOREDB_FUSION_ENABLE_HIDDEN')
os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN'] = '1'
self.conn = s2.connect(database=type(self).dbname, local_infile=True)
self.cur = self.conn.cursor()

Expand All @@ -537,11 +525,6 @@ def tearDown(self):
else:
del os.environ['SINGLESTOREDB_FUSION_ENABLED']

if self.hidden_enabled:
os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN'] = self.hidden_enabled
else:
del os.environ['SINGLESTOREDB_FUSION_ENABLE_HIDDEN']

try:
if self.cur is not None:
self.cur.close()
Expand Down

0 comments on commit 8b0d473

Please sign in to comment.