Skip to content

Commit

Permalink
feat: #708 Adding HA to the dev container for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
robbrad committed May 17, 2024
1 parent 899fad1 commit 3531611
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions uk_bin_collection/tests/council_feature_input_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def compare_councils(councils1, councils2, councils3):
set3 = set(councils3)
all_councils = set1 | set2 | set3
all_council_data = {}
discrepancies_found = False
for council in all_councils:
in_files = council in set1
in_json = council in set2
Expand All @@ -39,15 +40,17 @@ def compare_councils(councils1, councils2, councils3):
'in_features': in_features,
'discrepancies_count': discrepancies_count
}
return all_council_data
if discrepancies_count > 0:
discrepancies_found = True
return all_council_data, discrepancies_found

def main(branch):
# Execute and print the comparison
file_councils = get_councils_from_files(branch)
json_councils = get_councils_from_json(branch)
feature_councils = get_councils_from_features(branch)

all_councils_data = compare_councils(file_councils, json_councils, feature_councils)
all_councils_data, discrepancies_found = compare_councils(file_councils, json_councils, feature_councils)

# Create a list of lists for tabulate, sort by discrepancies count and then by name
table_data = []
Expand All @@ -65,6 +68,12 @@ def main(branch):
# Print the table using tabulate
print(tabulate(table_data, headers=headers, tablefmt='grid'))

if discrepancies_found:
print("Discrepancies found! Failing the workflow.")
sys.exit(1)
else:
print("No discrepancies found. Workflow successful.")

if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python script.py <branch>")
Expand Down

0 comments on commit 3531611

Please sign in to comment.