Skip to content
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

Create local QGIS unit tests #813

Closed
deltamarnix opened this issue Nov 21, 2023 · 5 comments · Fixed by #859
Closed

Create local QGIS unit tests #813

deltamarnix opened this issue Nov 21, 2023 · 5 comments · Fixed by #859

Comments

@deltamarnix
Copy link
Contributor

The tests can currently only run in the QGIS environment over docker. It would be easier in the workflow if we could create unit tests that can simply be run and debugged in vs code.

This might already work, but we have no tests proving it.

@deltamarnix deltamarnix moved this to What's next in Ribasim Nov 21, 2023
@deltamarnix deltamarnix moved this from What's next to 👀 In review in Ribasim Dec 1, 2023
@deltamarnix deltamarnix moved this from 👀 In review to 🏗 In progress in Ribasim Dec 1, 2023
@deltamarnix
Copy link
Contributor Author

We can still run all tests over docker. Any tests that do not involve the actual plugin to be loaded (ribasim_qgis/core files) can be run locally.

VS Code does not understand where to find the tests, since VS Code cannot do both pytest and unittest at the same time. But you can run it over F5 and simply make it run that one test file.

@visr @Hofer-Julian If you are alright with these kind of tests we can close the issue.

@deltamarnix deltamarnix moved this from 🏗 In progress to 👀 In review in Ribasim Dec 1, 2023
@deltamarnix
Copy link
Contributor Author

I have posted an issue about the test discovery not being successful now that I have conda installed on my computer.

microsoft/vscode-python#22581

@Hofer-Julian
Copy link
Contributor

Yes, let's close it!

@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Ribasim Dec 4, 2023
@deltamarnix
Copy link
Contributor Author

@Hofer-Julian There is a PR enclosed to this ticket

@Hofer-Julian
Copy link
Contributor

Ah, good that I am in the process of reviewing that one :P

deltamarnix added a commit that referenced this issue Dec 4, 2023
Can be run by calling `pixi run code.` to ensure the environment is set
correctly, then simply run it by pressing F5 to debug the local file.
The tests also run over `pixi run test-ribasim-qgis` in docker.

The tests cannot be found by VS code, since we are mixing `unittests`
and `pytest` and VS Code can only handle one type. Also, it seems to try
to activate a conda environment that is not present.

Fixes #813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants