-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter test files to exclude hidden and non-gleam files #63
base: main
Are you sure you want to change the base?
Conversation
let files = | ||
list.map(files, charlist.to_string) | ||
|> list.filter(fn(file) { | ||
string.ends_with(file, "test.gleam") && !string.starts_with(file, ".") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of just reading in the test directory, the .meta/config.json
file could be parsed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that would preclude students from uploading any additional test files. However I suppose the likelihood of that happening is extremely small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true 🤷
@lpil I think I'm running into a dependency problem with the tests I'm adding:
Do I need to publish my changes before I can test them? $ bin/setup-locally.sh
Downloading packages
Downloaded 14 packages in 0.11s
[...]
Compiling exercism_test_runner
[...]
Compiled in 6.24s
$ bin/run.sh bad_test_files $PWD/tests/bad_test_files{,}
Copying config and dependencies...
bad_test_files: compiling...
bad_test_files: testing...
Compiled in 0.04s
Running bad_test_files_test.main
exception error: #{function => <<"read_module">>,line => 75,
message => <<"Assertion pattern match failed">>,
module => <<"exercism/test_runner">>,
value => {error,{unexpected_token,panic,{position,0}}},
gleam_error => let_assert}
in function exercism@test_runner:read_module/1 (/Users/glennj/src/exercism/tracks/gleam-test-runner/packages/build/dev/erlang/exercism_test_runner/_gleam_artefacts/exercism@test_runner.erl, line 107)
in call from gleam@list:do_map/3 (/Users/glennj/src/exercism/tracks/gleam-test-runner/packages/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.erl, line 119)
in call from exercism@test_runner:main/0 (/Users/glennj/src/exercism/tracks/gleam-test-runner/packages/build/dev/erlang/exercism_test_runner/_gleam_artefacts/exercism@test_runner.erl, line 134)bad_test_files: done Try moving the altered test_runner.gleam into the new test: $ cp runner/src/exercism/test_runner.gleam tests/bad_test_files/build/packages/exercism_test_runner/src/exercism/test_runner.gleam
$ bin/run.sh bad_test_files $PWD/tests/bad_test_files{,}
[same exception as above] Try moving the altered test_runner.gleam into the project's build hierarchy $ cp runner/src/exercism/test_runner.gleam packages/build/packages/exercism_test_runner/src/exercism/test_runner.gleam
$ bin/run.sh bad_test_files $PWD/tests/bad_test_files{,}
Copying config and dependencies...
bad_test_files: compiling...
bad_test_files: testing...
Compiled in 0.04s
Running bad_test_files_test.main
.......
Ran 7 tests, 0 failed
bad_test_files: done |
This repo contains both the Gleam test runner library, and also the Exercism test runner for Gleam that uses that library. They are two different things and the library is distributed on Hex (so everyone can use it) so it needs to be published prior to being used by Exercism. |
Filter the files in the test directory to exclude possible bad ones.
Fixes #62