From 7d52d7dca8866ff857086bcf4777d5312a98e037 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Fri, 3 Apr 2026 10:30:07 +0200 Subject: [PATCH] add justfile for testing --- justfile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ test_run.sh | 7 ------- 2 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 justfile delete mode 100755 test_run.sh diff --git a/justfile b/justfile new file mode 100644 index 0000000..d6f32ea --- /dev/null +++ b/justfile @@ -0,0 +1,49 @@ +# Justfile for Migrate Database Changes Workflow +# Docs: https://just.systems/man/en/ + +# ------------------------------------------------------------------------------ +# Global settings +# ------------------------------------------------------------------------------ + +# Load Env +set dotenv-load +set dotenv-required := true + +# Use zsh +set shell := ["bash", "-cu"] + +# ------------------------------------------------------------------------------ +# Default +# ------------------------------------------------------------------------------ + +# List all Available recipes +[private] +default: + @just --list --unsorted + +# ------------------------------------------------------------------------------ +# Snake Script helpers +# ------------------------------------------------------------------------------ +run: + "{{justfile_directory()}}/main.py" + +# ------------------------------------------------------------------------------ +# Testing helpers +# ------------------------------------------------------------------------------ + +test-constrictor: + #!/usr/bin/env bash + set -euo pipefail + + BATTLESNAKE_CLI=battlesnake_cli_1.2.3_Linux_x86_64/battlesnake + $BATTLESNAKE_CLI play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g constrictor --browser --minimumFood 0 + +test-seed: + #!/usr/bin/env bash + set -euo pipefail + + BATTLESNAKE_CLI=battlesnake_cli_1.2.3_Linux_x86_64/battlesnake + $BATTLESNAKE_CLI play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g solo --browser --seed 1713099635738952360 + +export-dataset input="data" output="data/dataset/good_moves.jsonl": + python -m server.DatasetExporter --input "{{input}}" --output "{{output}}" diff --git a/test_run.sh b/test_run.sh deleted file mode 100755 index f6278b8..0000000 --- a/test_run.sh +++ /dev/null @@ -1,7 +0,0 @@ -BATTLESNAKE_CLI=battlesnake_cli_1.2.3_Linux_x86_64/battlesnake - -if [ -z $1 ]; then - $BATTLESNAKE_CLI play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g solo --browser --seed 1713099635738952360 -else - $BATTLESNAKE_CLI play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g constrictor --browser --minimumFood 0 -fi