From d5820db7f8472302b4460436316d3e853b590246 Mon Sep 17 00:00:00 2001 From: Robert Bradley Date: Sun, 26 May 2024 08:09:18 +0100 Subject: [PATCH 1/4] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 12d67ae7f6..5c5e85772d 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ integration-tests: ## runs tests for the project fi parity-check: - poetry run python uk_bin_collection/tests/council_feature_input_parity.py $(branch) + poetry run python uk_bin_collection/tests/council_feature_input_parity.py $(repo) $(branch) unit-tests: poetry run coverage erase From 458ca73d887458a576c019c51f67931cdb561806 Mon Sep 17 00:00:00 2001 From: Robert Bradley Date: Sun, 26 May 2024 08:12:02 +0100 Subject: [PATCH 2/4] Update behave.yml --- .github/workflows/behave.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index 5aac111d78..28a3575840 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -52,8 +52,9 @@ jobs: - name: Check Parity of Councils / input.json / Feature file run: | + repo=${{ github.repository || 'robbrad/UKBinCollectionData' }} branch=${{ github.event.pull_request.head.ref || 'master' }} - make parity-check branch=$branch + make parity-check repo=$repo branch=$branch - name: Get all councils files that have changed id: changed-council-files From 3b0814643f69c8626bf4614287143d706deaba91 Mon Sep 17 00:00:00 2001 From: Robert Bradley Date: Sun, 26 May 2024 08:18:35 +0100 Subject: [PATCH 3/4] Update council_feature_input_parity.py --- uk_bin_collection/tests/council_feature_input_parity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uk_bin_collection/tests/council_feature_input_parity.py b/uk_bin_collection/tests/council_feature_input_parity.py index 92126e8851..88aecfa29f 100644 --- a/uk_bin_collection/tests/council_feature_input_parity.py +++ b/uk_bin_collection/tests/council_feature_input_parity.py @@ -15,7 +15,7 @@ def get_councils_from_files(repo, branch): if response.status_code == 200: try: data = response.json() - print(f"Parsed JSON Data (Files): {data}") + #print(f"Parsed JSON Data (Files): {data}") # Ensure 'data' is a list before proceeding if isinstance(data, list): return [item['name'].replace('.py', '') for item in data if item['name'].endswith('.py')] @@ -40,7 +40,7 @@ def get_councils_from_json(repo, branch): if response.status_code == 200: try: data = json.loads(response.text) - print(f"Parsed JSON Data: {data}") + #print(f"Parsed JSON Data: {data}") return list(data.keys()) except json.JSONDecodeError as e: print(f"JSON decoding error: {e}") @@ -59,7 +59,7 @@ def get_councils_from_features(repo, branch): if response.status_code == 200: content = response.text - print(f"Fetched Features Content: {content[:500]}...") # Print only the first 500 characters for brevity + #print(f"Fetched Features Content: {content[:500]}...") # Print only the first 500 characters for brevity return re.findall(r'Examples:\s+(\w+)', content) else: print(f"Failed to fetch councils from features: {response.content}") From e6e2bc82b4546c2526a1f026897e69e0ff7d4270 Mon Sep 17 00:00:00 2001 From: Robert Bradley Date: Sun, 26 May 2024 08:21:09 +0100 Subject: [PATCH 4/4] Update council_feature_input_parity.py --- uk_bin_collection/tests/council_feature_input_parity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uk_bin_collection/tests/council_feature_input_parity.py b/uk_bin_collection/tests/council_feature_input_parity.py index 88aecfa29f..c770815185 100644 --- a/uk_bin_collection/tests/council_feature_input_parity.py +++ b/uk_bin_collection/tests/council_feature_input_parity.py @@ -94,9 +94,9 @@ def main(repo="robbrad/UKBinCollectionData", branch="master"): json_councils = get_councils_from_json(repo, branch) feature_councils = get_councils_from_features(repo, branch) - print(f"Councils from files: {file_councils}") - print(f"Councils from JSON: {json_councils}") - print(f"Councils from features: {feature_councils}") + #print(f"Councils from files: {file_councils}") + #print(f"Councils from JSON: {json_councils}") + #print(f"Councils from features: {feature_councils}") all_councils_data, discrepancies_found = compare_councils(file_councils, json_councils, feature_councils)