Skip to content

Add pytest#11

Open
duartegalvao wants to merge 2 commits intomasterfrom
feat/pytest
Open

Add pytest#11
duartegalvao wants to merge 2 commits intomasterfrom
feat/pytest

Conversation

@duartegalvao
Copy link

No description provided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern on Indico core is to have pytest.ini in the project root. Why not following the same pattern? If so, we would need to add the submodules (i.e., indico, plugins) to norecursedirs.

@@ -0,0 +1,24 @@
[pytest]
; exclude unrelated folders
norecursedirs =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a few entries missing here, compared to Indico core, that may be interesting to have as well.

  • dist
  • etc
  • node_modules

Comment on lines +5 to +6
migrations
client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that you have declared these without the indicorp/ prefix so that the file can be reused across repositories. This will, however, also ignore any migrations or client subdirectory, if they are ever added. Since we need to specify the name of the plugin, nonetheless in indico_plugins, I would prefer that we have a glob pattern that is explicit.

Suggested change
migrations
client
indicorp/client
indicorp/migrations

Comment on lines +143 to +144
test-plugin: _check_plugin_pytest
uv run pytest -c plugins/$(plugin)/pytest.ini plugins/$(plugin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this too much voodoo or is it divine intellect?

I'm not sure that we should be making assumptions about whether a plugin has pytest tests or not and, if it does, where the pytest.ini file might be located.

Each plugin directory is its own standalone project with its own architecture and QA decisions. This Makefile target breaks that isolation in ways that I'm not sure we should. If we did, then, why not also adding a target for building wheels, linting, another one for DB schema migrations, etc.?

The isolation that I speak of would still be justified for the building assets, as this one is necessary for setting up the plugin in the dev environment and relies on standard indico mechanisms.

uvx maildump
```

### Running tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this section belongs in a CONTRIBUTING.md file.


.PHONY: test-distro
test-distro:
uv run pytest -c $(DISTRO)/pytest.ini $(DISTRO)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep pytest.ini in the root of the project, we can change this line by:

Suggested change
uv run pytest -c $(DISTRO)/pytest.ini $(DISTRO)
uv run pytest

Comment on lines +136 to +138
.PHONY: test-core
test-core:
uv run pytest -c indico/pytest.ini indico
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have similar concerns with this target as I have with test-plugin (https://github.com/unconventionaldotdev/indicorp/pull/11/changes#r2782634229).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants