James round seconds (#129)

this is a ford of jd/harness-fixes that is currently live on the
benches, the ONLY thing i changed is im rounding the timestamps to the
nearest second

please approve

---------

Co-authored-by: J-Doiron <139803019+J-Doiron@users.noreply.github.com>
This commit is contained in:
j-lin-lmg
2025-04-09 14:34:19 -07:00
committed by GitHub
parent 0cff2aae7c
commit 36c542be4a
74 changed files with 2115 additions and 257 deletions

View File

@@ -160,7 +160,7 @@ def run_benchmark():
copy_no_intro_mod()
# Start game via Steam and enter fullscreen mode
setup_start_time = time.time()
setup_start_time = int(time.time())
start_game()
time.sleep(20)
@@ -173,7 +173,7 @@ def run_benchmark():
navigate_settings()
# Start the benchmark!
setup_end_time = time.time()
setup_end_time = int(time.time())
elapsed_setup_time = round(setup_end_time - setup_start_time, 2)
logging.info("Harness setup took %f seconds", elapsed_setup_time)
@@ -182,7 +182,7 @@ def run_benchmark():
logging.info("Benchmark didn't start.")
sys.exit(1)
test_start_time = time.time() - 5
test_start_time = int(time.time()) - 5
logging.info("Benchmark started. Waiting for benchmark to complete.")
time.sleep(60)
@@ -193,7 +193,7 @@ def run_benchmark():
am.take_screenshot("results.png", ArtifactType.RESULTS_IMAGE, "results of benchmark")
test_end_time = time.time() - 2
test_end_time = int(time.time()) - 2
time.sleep(2)
elapsed_test_time = round((test_end_time - test_start_time), 2)
logging.info("Benchmark took %f seconds", elapsed_test_time)

View File

@@ -5,10 +5,14 @@ import logging
from pathlib import Path
import re
import shutil
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from harness_utils.steam import get_app_install_location
SCRIPT_DIRECTORY = Path(__file__).resolve().parent
CYBERPUNK_INSTALL_DIR = Path(
os.environ["ProgramFiles(x86)"], "Steam\\steamapps\\common\\Cyberpunk 2077")
STEAM_GAME_ID = 1091500
CYBERPUNK_INSTALL_DIR = get_app_install_location(STEAM_GAME_ID)
def get_args() -> any:
@@ -31,7 +35,7 @@ def copy_from_network_drive():
def copy_no_intro_mod() -> None:
"""Copies no intro mod file"""
try:
mod_path = CYBERPUNK_INSTALL_DIR / "archive" / "pc" / "mod"
mod_path = Path(f"{CYBERPUNK_INSTALL_DIR}\\archive\\pc\\mod")
mod_path.mkdir(parents=True, exist_ok=True)
src_path = SCRIPT_DIRECTORY / "basegame_no_intro_videos.archive"