
@stevenkw has joined the channel

Is it ok to subvert raco test
by including (module test racket/base)
in my code?https://github.com/nixin72/from-template/blob/master/main.rkt

I should have a test but I can’t think of one right now. [...]
raco setup: --- post-installing collections --- [3:32:43]
raco test: "/home/root//user/.racket/7.8/pkgs/from-template/info.rkt"
raco test: "/home/root//user/.racket/7.8/pkgs/from-template/main.rkt"
main.rkt: raco test: non-empty stderr: #"Need to supply a name of a template. Checkout <https://github.com/racket-templates> for a list of available templates.\n context...:\n \"/home/root/user/.racket/7.8/pkgs/from-template/main.rkt\": [running body]\n temp35_0\n for-loop\n run-module-instance!\n (submod \"/home/root/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt\" process): [running body]\n temp35_0\n for-loop\n run-module-instance!\n eval-one-top\n"
raco test: "/home/root//user/.racket/7.8/pkgs/from-template/scribblings/from-template.scrbl"
1/1 test failures
0 /home/root//user/.racket/7.8/pkgs/from-template/info.rkt
0 /home/root//user/.racket/7.8/pkgs/from-template/scribblings/from-template.scrbl
1 1 /home/root//user/.racket/7.8/pkgs/from-template/main.rkt
The time is now Friday, September 11th, 2020 3:32:45am
https://pkg-build.racket-lang.org/server/built/test-fail/from-template.txt

Yes, (module test racket/base)
seems like the right choice.

ta. I need to make a test that ensures it doesn’t overwrite any user data, but that can wait. :slightly_smiling_face:

it’s documented in section 13.2 of https://docs.racket-lang.org/raco/test.html?q=raco%20test but it’s hard to find since it’s only a short phrase in the first paragraph. I’ve used the same approach to prevent raco test
from running a module.
Also it looks like it’s possible to add to test-omit-paths
in an info.rkt
file in your collection package if that option works better for you.

moving code you don’t want to run into a main
submodule would be preferable to an empty test
submodule IMO, assuming it makes sense for your use case

(case where it makes sense: a script / launcher program)

(case where it doesn’t: trying to avoid loading GUI libraries)

@hj93 has joined the channel

@robots-racket-slack has joined the channel