1) run Analyzer with Docker fails 2) how to test the analyzer?

Hi, I have implemented the analyzer for the exercise “warriors-and-wizards-2” of the Java track.

  1. I was trying to run the docker command with the necessary parameters.
docker run \
        --rm \
        --network none \
        --mount type=bind,src="${solution_dir}",dst=/solution \
        --mount type=bind,src="${output_dir}",dst=/output \
        --tmpfs /tmp:rw \
        "exercism/${track_slug}-analyzer" \
        "${exercise_slug}" "/solution" "/output"

but it fails in recognize the output directory.

: not founder/bin/run.sh: 2: 
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid directory: /output
        at analyzer.AnalyzerCli.validateDirectory(AnalyzerCli.java:21)
        at analyzer.AnalyzerCli.main(AnalyzerCli.java:35)

What am I doing wrong?

  1. I am wondering how to test the code of the analyzer. Looking at the old topics (Implementing analyzer for gotta-snatch-em-all in the Java track - Exercism - Exercism) I have found this answer:

For the unit tests, its fine to just run the ones that are already there (assuming we add smoke tests for the analyzer). Once you’ve added them, run the docker script to run the tests.

Should I just run the “GlobalAnalyzerTest.java” tests in the folder test/java/analyzer/exercises ?
And where can I found the docker script to run the tests? I have been looking on the documentation but I cannot find it.

The format of that error message indicates that your shell script has got “carriage return newline” endings. Change the script to use unix style newline-only endings.

Thanks! it worked :slight_smile: