From 663762f64b7c1b9a8eaf32396a76c9ff9d37188a Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 15:09:00 +0800 Subject: [PATCH 1/7] set purview name environment variable in workflow --- .github/workflows/pull_request_push_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_push_test.yml b/.github/workflows/pull_request_push_test.yml index 88f27cbbf..5cb10fa1c 100644 --- a/.github/workflows/pull_request_push_test.yml +++ b/.github/workflows/pull_request_push_test.yml @@ -285,7 +285,7 @@ jobs: AZURE_CLIENT_ID: ${{secrets.AZURE_CLIENT_ID}} AZURE_TENANT_ID: ${{secrets.AZURE_TENANT_ID}} AZURE_CLIENT_SECRET: ${{secrets.AZURE_CLIENT_SECRET}} - PURVIEW_NAME: ${{secrets.PURVIEW_NAME}} + PURVIEW_NAME: "feathrazuretest3-purview1" CONNECTION_STR: ${{secrets.CONNECTION_STR}} run: | pytest --cov-report term-missing --cov=registry/sql-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_sql_registry.py From fab673d179cffae1723e8059a07fa2ad2870c7e6 Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 15:13:56 +0800 Subject: [PATCH 2/7] temp change to test purview registry --- .github/workflows/pull_request_push_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_push_test.yml b/.github/workflows/pull_request_push_test.yml index 5cb10fa1c..853ffb664 100644 --- a/.github/workflows/pull_request_push_test.yml +++ b/.github/workflows/pull_request_push_test.yml @@ -288,7 +288,7 @@ jobs: PURVIEW_NAME: "feathrazuretest3-purview1" CONNECTION_STR: ${{secrets.CONNECTION_STR}} run: | - pytest --cov-report term-missing --cov=registry/sql-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_sql_registry.py + #pytest --cov-report term-missing --cov=registry/sql-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_sql_registry.py pytest --cov-report term-missing --cov=registry/purview-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_purview_registry.py failure_notification: From 8fe59c7da36518ef86383447420308f7b7c3aa46 Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 15:26:19 +0800 Subject: [PATCH 3/7] set 'API_BASE' environment variable --- .github/workflows/pull_request_push_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_push_test.yml b/.github/workflows/pull_request_push_test.yml index 853ffb664..8b6ed8b6e 100644 --- a/.github/workflows/pull_request_push_test.yml +++ b/.github/workflows/pull_request_push_test.yml @@ -287,8 +287,9 @@ jobs: AZURE_CLIENT_SECRET: ${{secrets.AZURE_CLIENT_SECRET}} PURVIEW_NAME: "feathrazuretest3-purview1" CONNECTION_STR: ${{secrets.CONNECTION_STR}} + API_BASE: "api/v1" run: | - #pytest --cov-report term-missing --cov=registry/sql-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_sql_registry.py + pytest --cov-report term-missing --cov=registry/sql-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_sql_registry.py pytest --cov-report term-missing --cov=registry/purview-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_purview_registry.py failure_notification: From cce9a4353726ac76733e6ace47c9a65bf49b4663 Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 15:37:01 +0800 Subject: [PATCH 4/7] temp change to test purview --- registry/test/test_purview_registry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/registry/test/test_purview_registry.py b/registry/test/test_purview_registry.py index 8f72ceeea..e7b1fd6be 100644 --- a/registry/test/test_purview_registry.py +++ b/registry/test/test_purview_registry.py @@ -9,9 +9,12 @@ class PurviewRegistryTest(unittest.TestCase): def setup(self): + purview_name = "feathrazuretest3-purview1" + ''' purview_name = os.getenv('PURVIEW_NAME') if purview_name is None: raise RuntimeError("Failed to run Purview registry test case. Cannot get environment variable: 'PURVIEW_NAME'") + ''' self.registry = PurviewRegistry(purview_name) def cleanup(self, ids): From d04aa6c84d7f60e847dc1937a4ed0ca7109aaaf1 Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 16:33:25 +0800 Subject: [PATCH 5/7] quick fix --- registry/test/test_purview_registry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/test/test_purview_registry.py b/registry/test/test_purview_registry.py index e7b1fd6be..81b87fcb0 100644 --- a/registry/test/test_purview_registry.py +++ b/registry/test/test_purview_registry.py @@ -26,7 +26,6 @@ def create_and_get_project(self, project_name): assert project_id is not None project = self.registry.get_entity(project_id) assert project.qualified_name == project_name - assert self.registry.get_entity_id(project_name) == str(project_id) return project_id def create_and_get_data_source(self, project_id, qualified_name, name, path, type): @@ -74,7 +73,8 @@ def test_registry(self): project_id = self.create_and_get_project(project_name) # re-create project, should return the same id id = self.registry.create_project(ProjectDef(project_name)) - assert project_id == id + assert project_id == id + assert self.registry.get_entity_id(project_name) == str(project_id) projects = self.registry.get_projects() assert len(projects) >= 1 project_ids = self.registry.get_projects_ids() From bbf4831112ce563e1e2d782bf6d5ce96af562e06 Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 16:44:32 +0800 Subject: [PATCH 6/7] quick fix --- .github/workflows/pull_request_push_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull_request_push_test.yml b/.github/workflows/pull_request_push_test.yml index 8b6ed8b6e..5cb10fa1c 100644 --- a/.github/workflows/pull_request_push_test.yml +++ b/.github/workflows/pull_request_push_test.yml @@ -287,7 +287,6 @@ jobs: AZURE_CLIENT_SECRET: ${{secrets.AZURE_CLIENT_SECRET}} PURVIEW_NAME: "feathrazuretest3-purview1" CONNECTION_STR: ${{secrets.CONNECTION_STR}} - API_BASE: "api/v1" run: | pytest --cov-report term-missing --cov=registry/sql-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_sql_registry.py pytest --cov-report term-missing --cov=registry/purview-registry/registry --cov-config=registry/test/.coveragerc registry/test/test_purview_registry.py From 30bb6e4c48758c29cbbe11bae6278003a6b4c6bb Mon Sep 17 00:00:00 2001 From: enya-yx Date: Wed, 11 Jan 2023 16:54:49 +0800 Subject: [PATCH 7/7] quick revert --- registry/test/test_purview_registry.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/registry/test/test_purview_registry.py b/registry/test/test_purview_registry.py index 81b87fcb0..a0f12ea34 100644 --- a/registry/test/test_purview_registry.py +++ b/registry/test/test_purview_registry.py @@ -9,12 +9,10 @@ class PurviewRegistryTest(unittest.TestCase): def setup(self): - purview_name = "feathrazuretest3-purview1" - ''' purview_name = os.getenv('PURVIEW_NAME') if purview_name is None: raise RuntimeError("Failed to run Purview registry test case. Cannot get environment variable: 'PURVIEW_NAME'") - ''' + self.registry = PurviewRegistry(purview_name) def cleanup(self, ids):