Issues Running the test_algo_mac script

I ran into some issues while trying to run the test_algo_mac from terminal on my Mac. I did manage to resolve them, but since I did not find any info on here I thought I’d share it.

When I tried to run the $ ./test_algo_mac from the scripts folder I’d get command not found. Then I went back to the repo root and tried $ ./scripts/test_algo_mac I got Permission denied, so tried running it with sudo but got the same error as before command not found. I tried a bunch more things, but to cut a long story short I ended up on this webpage

What I did to fix the problem was, to run $ chmod +x test_algo_mac to mark the file as an executable as the site suggested and then I tried $ ./test_algo_mac, it worked!

Problem solved. Hope this helps someone.

1 Like

Interesting that your permissions were not executable by default, though it makes sense that some system would have some security option that set it as not executable, to prevent people from executing unsafe scripts.

I’ll add ‘check/add execution permissions’ to the troubleshooting guide, thanks for the tip.

Does ./test_algo_mac test versus both sides defenses?

When I run it it seems to be playing against my defense (on the tpo side in the replay) so haven’t been able to recreate a crash.

Could you clarify what you mean by this, if my below assumption is incorrect?

If you are asking whether it tests by placing your algo on both sides of the map, it shouldn’t matter, as your algo is always player1 from its own perspective, and the game engine sorts out the rest.
If there is an issue that is dependant on which side of the map your algo is on, that would be a bug, and more details would be appreciated.

when I ran it the testing engine appeared to be playing against my own defense, in the replays my defense is usually on top as play 2. i’ll double check that perhaps I was confused. eventually figured out my crash so ok for now.

1 Like

Same on the windows version of the test script.
Match Replay orientation breaks local tests with test_aglo_os

When you get a replay file from a public match, where my algo is “on top”, player 2,
and then try to feed this replay to the local test script …
you end up playing with the enemy game state for the turn, vs your game state (as in the replay) and execute
the logic for the local algo. Which … is almost unuasable.

This is kind of expected as it will be similar if you feed random replay file to the test_script_os … with not matchin algo. Is there there an easy way to “reverce” the replay file . eather on export, or when feeding it to the test_script_os ?

For anyone having this problem, or is just interested in the capability of switching views, I wrote a quick script to switch players for a replay file (or list of files).

The script can be found here: