-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can't run tests in a new Basilisp project #1069
Comments
This is an interesting one. I haven't really run tests outside of this repository yet, so not surprising I haven't run into this issue. Aside from the I think eventually whatever project tooling I end up building would do something similar to Leiningen or clj and can set the paths for tests and sources correctly. |
I think the problem is with the basilisp testrunner. > basilisp run -c "(println sys/path)"
#py ["" ... "D:\\bas\\issuetests\\src"] I've created a minimal repo at https://github.com/ikappaki/basilisp-issue-1069 to demonstrate in practice, with the following branches
That would be a great addition. However, I believe the issue here is related to the test runner: Thanks |
It's harder to test this, but I didn't add the path fixes to |
The tests were mainly run using I think we can set this aside for now since the workaround of adding an empty thanks |
@ikappaki I pulled down the repo to try to understand the issue. I'm noticing that when I do add the
I'm going to push a PR that makes the small change to the I'd like to fix this correctly in the future, but will need to think a bit more on how to do that. |
Hi @chrisrink10, thanks for looking into this. It works great now! The key piece I was missing was the #1075 fix that ensures Now, I understand that testing should indeed be driven through I have two further suggestion, if you don't mind.
(basilisp-pprint-py3.11) PS C:\clj\basilisp-pprint> basilisp test -h
usage: basilisp test [-h] [--generate-auto-inlines [GENERATE_AUTO_INLINES]] [--inline-functions [INLINE_FUNCTIONS]]
[--warn-on-arity-mismatch [WARN_ON_ARITY_MISMATCH]]
[--warn-on-shadowed-name [WARN_ON_SHADOWED_NAME]] [--warn-on-shadowed-var [WARN_ON_SHADOWED_VAR]]
[--warn-on-unused-names [WARN_ON_UNUSED_NAMES]]
[--warn-on-non-dynamic-set [WARN_ON_NON_DYNAMIC_SET]]
[--use-var-indirection [USE_VAR_INDIRECTION]]
[--warn-on-var-indirection [WARN_ON_VAR_INDIRECTION]]
[--include-unsafe-path [INCLUDE_UNSAFE_PATH]] [-p INCLUDE_PATH]
[--data-readers-entry-points [DATA_READERS_ENTRY_POINTS]] [--disable-ns-cache [DISABLE_NS_CACHE]]
[--enable-logger [ENABLE_LOGGER]] [-l LOG_LEVEL]
[--emit-generated-python [EMIT_GENERATED_PYTHON]]
Run tests in a Basilisp project.
positional arguments:
args arguments passed on to Pytest
... Another related thought: would it be possible to provide both brief and verbose help optoins for the CLI commands? at the moment, the output is cluttered with numerous compiler, runtime and debugging arguments, many of which would not be relevant when you are just looking for testing relating options, for example.
I'm very satisfied with the current fix, as things are now much clearer! Thanks again. |
Seems reasonable!
I'm not sure if there's an easy way to do this that wouldn't be really ugly, but running
The main reason I didn't do this was because short arguments become non-mnemonic rather quickly and there are only so many letters available. If you had any suggestion for how to handle that, I'd certainly be willing to consider it. |
I was not familiar with the
My apologies for the confusion, I misused the terminology. What I had in mind was that Thanks |
Hi,
it's not possible to execute
Basilisp
tests in a new project due to the following errorTo reproduce with
poetry
issuetests
project, addbasilisp
andpytest
deps, and install project./tests/issuetests/issue_test.lpy
pytest
, you will encounter the "No module named 'tests' error"The same error occurs when running
basilisp test
.A workaround I found to bypass this issue is to create an empty
conftest.py
file./tests/conftest.py
(Empty)though this is not mentioned in the official documentation as a requirement https://basilisp.readthedocs.io/en/v0.1.1/gettingstarted.html#project-structure
Running
basilisp test
gives an extra warning, but I this is unrelated to this issueThanks
The text was updated successfully, but these errors were encountered: