notjack
2019-10-31 07:01:50

@sorawee if you have realpath available on your system, you can convert the relative path to an absolute path directly at the command line


notjack
2019-10-31 07:03:28
raco test ++args $(realpath ./foo/bar.txt) sub/main.rkt

notjack
2019-10-31 07:03:34

(disclaimer: haven’t actually tested that)


sorawee
2019-10-31 07:04:36

Great solution! I still do hope that there will be a way to do it within Racket, though.


notjack
2019-10-31 07:06:02

I’m not actually sure there should be. That would mean that whether a test passes or fails can depend on the current directory of the script that calls raco test, which can wreak havoc with CI systems. It’s good to avoid situations where a test can pass locally but fail in CI, or vice versa.


mflatt
2019-10-31 12:14:18

Yes. There’s no way to find out what a module’s exports map to without having the module.


samth
2019-10-31 13:08:42

Maybe there should be a parameter that provides the original directory


sorawee
2019-10-31 19:22:40

While I think this is a good default behavior, there should be an escape hatch. I think about this in the same way as hygienity: by default we should prevent people from shooting themselves in the foot, but if there’s any reason they really want to do that, we should also provide an explicit way to do it.


dmitryhertz
2019-10-31 19:46:08

Hello friends! I’ve a question about Jesse Alama’s book «Server: racket», — does it cover continuations topic? I’m thinking about should I buy it right now or it would be better to not hurry. Continuations in web-dev is the most interesting topic for me now.


notjack
2019-10-31 20:15:59

Does the realpath approach count as an escape hatch?

There could still be an in-racket escape hatch, but I don’t personally find this particular use case very compelling on its own.


notjack
2019-10-31 20:22:32

@dmitryhertz I don’t know the answer to your question, but out of curiosity what sort of web dev are you interested in?


ryanc
2019-10-31 21:31:35

I think if your tests take arguments and need the original directory, you should probably write a module to configure and launch them and run that with racket instead of raco test. That’s how most of the db and crypto tests are run, for example.


samth
2019-10-31 22:08:30

I think we should expect raco test to work in all situations


samth
2019-10-31 22:11:17

I believe it does not, but he’s writing something new about that https://gumroad.com/l/short-intro-web-programming-continuations


notjack
2019-10-31 22:14:22

I don’t think it’s raco test that’s not working in that situation, I think it’s a problem with how the test module in question expects users to configure it.


mflatt
2019-11-1 02:03:01

@leif module->exports now supports an option to report the defined name that implements each provided name.


notjack
2019-11-1 04:11:02

happy halloween :bat: :bat: :bat: