fixed linter issues and implemented steam build ID feature

This commit is contained in:
Arty Blue
2024-10-03 15:06:46 -07:00
parent 27baaefb39
commit f917f38de6

View File

@@ -20,7 +20,7 @@ from harness_utils.output import (
DEFAULT_LOGGING_FORMAT,
DEFAULT_DATE_FORMAT
)
from harness_utils.steam import get_app_install_location
from harness_utils.steam import get_app_install_location, get_build_id
from harness_utils.keras_service import KerasService
from harness_utils.artifacts import ArtifactManager, ArtifactType
@@ -32,8 +32,7 @@ STEAM_GAME_ID = 1142710
APPDATA = os.getenv("APPDATA")
CONFIG_LOCATION = f"{APPDATA}\\The Creative Assembly\\Warhammer3\\scripts"
CONFIG_FILENAME = "preferences.script.txt"
cfg = f"{CONFIG_LOCATION}\\{CONFIG_FILENAME}"
CONFIG_FULL_PATH = f"{CONFIG_LOCATION}\\{CONFIG_FILENAME}"
user.FAILSAFE = False
@@ -71,7 +70,6 @@ def run_benchmark():
start_game()
setup_start_time = time.time()
time.sleep(5)
am = ArtifactManager(LOG_DIRECTORY)
result = kerasService.look_for_word("warning", attempts=10, interval=5)
@@ -159,7 +157,7 @@ def run_benchmark():
time.sleep(5)
am.take_screenshot("result.png", ArtifactType.RESULTS_IMAGE, "benchmark results")
am.copy_file(Path(cfg), ArtifactType.RESULTS_TEXT, "preferences.script.txt")
am.copy_file(Path(CONFIG_FULL_PATH), ArtifactType.RESULTS_TEXT, "preferences.script.txt")
# End the run
elapsed_test_time = round(test_end_time - test_start_time, 2)
@@ -198,7 +196,8 @@ try:
report = {
"resolution": format_resolution(width, height),
"start_time": seconds_to_milliseconds(start_time),
"end_time": seconds_to_milliseconds(endtime)
"end_time": seconds_to_milliseconds(endtime),
"version": get_build_id(STEAM_GAME_ID)
}
write_report_json(LOG_DIRECTORY, "report.json", report)