diff --git a/count_by_instrumentation.py b/count_by_instrumentation.py index 991f5fa..76c2c3d 100644 --- a/count_by_instrumentation.py +++ b/count_by_instrumentation.py @@ -2,6 +2,7 @@ from typing import List import pandas as pd import seaborn as sns +from datetime import timedelta import matplotlib.pyplot as plt import argparse @@ -35,7 +36,12 @@ def main(args): keyword="test" ) - today = datetime.now().date().strftime("%Y-%m-%dT%H:%M:%SZ") + today = datetime.now().date() + + today_plus_one = today + timedelta(days=1) + + # Format the date + today_plus_one_str = today_plus_one.strftime("%Y-%m-%dT%H:%M:%SZ") commit = app.get_commit_by_date(date=today, repository=args.repo) repo_files = app.get_repository_by_commit( diff --git a/latest-groovy-detailed.png b/latest-groovy-detailed.png new file mode 100644 index 0000000..71bd0b4 Binary files /dev/null and b/latest-groovy-detailed.png differ diff --git a/latest-groovy.png b/latest-groovy.png new file mode 100644 index 0000000..39e5c2c Binary files /dev/null and b/latest-groovy.png differ diff --git a/main.py b/main.py index 65204e2..042bc2f 100644 --- a/main.py +++ b/main.py @@ -122,7 +122,7 @@ def main(args): plt.xlabel('Date', fontsize=14) plt.ylabel('Count', fontsize=14) - plt.title('Test File Count in Instrumentation Directory', fontsize=16) + plt.title('Count of test files in Instrumentation directory', fontsize=16) plt.xticks(rotation=45) plt.legend() diff --git a/media/example_pie_output.png b/media/example_pie_output.png index cece08e..96d6ed0 100644 Binary files a/media/example_pie_output.png and b/media/example_pie_output.png differ diff --git a/utilities.py b/utilities.py index 6cdf4e3..b01678f 100644 --- a/utilities.py +++ b/utilities.py @@ -20,11 +20,14 @@ def get_dates_between(start_date_str, end_date, interval): days_diff = (end_date - start_date).days # Generate the list of dates - date_list = [] + date_list = set() for i in range(0, days_diff + 1, int(interval)): date_item = start_date + timedelta(days=i) start_date_str = date_item.strftime(output_format) - date_list.append(start_date_str) + date_list.add(start_date_str) + + # always include today in the set + date_list.add(datetime.now().strftime(output_format)) return date_list