-
Notifications
You must be signed in to change notification settings - Fork 37
Split project tests #426
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
Split project tests #426
Changes from all commits
07a5861
8bfe003
5b3be35
a1ef2a1
f9eb388
6ee4c5c
6103952
7773347
120b437
10b35fb
c1d5c05
bce66a9
623a44a
14f0760
838928e
d0acf31
c040884
08126f2
a15148a
4af3596
bec0978
c65f7dd
7822ca2
c759c3a
9089191
0c4252a
d927cd3
cb20190
f217ea1
c2b202b
51a6f39
0765de6
eebbdd3
b858c33
1a4b58f
4c16d0f
087befd
8a0271f
782c0bc
6ba1eba
8b127fa
170ffac
e40f68d
33e00d8
3e9ada1
dbfef28
b851eeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Adding a project to pySDC (and automatic testing) | ||
|
|
||
| When you do a project with pySDC we appreciate it if you merge it back to the main repository. | ||
| We are committed to keeping your work reproducible and prevent it from fading into oblivion. | ||
| To that end, please write extensive tests for your code and add them to the project. | ||
| See the [contribution guide](./../../CONTRIBUTING.md) for general advice on testing etc. | ||
| This guide will detail only how to add a project to pySDC. | ||
|
|
||
| ## Add a directory in 'pySDC/projects' | ||
|
|
||
| First, create a new directory in `pySDC/projects` with the name of your project. | ||
| The code of the new project should go into that newly created directory. | ||
|
|
||
| ## Add an environment-file | ||
|
|
||
| The testing pipeline uses [micromamba](<https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html>) | ||
| and requires an environment file for setup. | ||
| This includes the dependencies that are required for your project to run. | ||
| The file needs to be named `environment.yml` and needs to follow the structure shown below: | ||
|
|
||
| ```yaml | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - numpy | ||
| ``` | ||
|
|
||
| The list of dependencies can be extended as needed. | ||
| The name should stay `pySDC`. The channels cover most of the usual packages. | ||
| If a package is needed that cannot be found in those channels by conda (or mamba), | ||
| please add the correct channel to the list. | ||
|
|
||
| ## Add tests to the project | ||
|
|
||
| In order to automatically find the tests of your project, please add the tests to a subdirectory called `tests` in the directory of your project. | ||
| Furthermore, the files should start with `test_` and the functions should also start with that. | ||
| For more information see the documentation of pytest on [test discovery](<https://docs.pytest.org/en/8.2.x/explanation/goodpractices.html#tests-as-part-of-application-code>). | ||
|
|
||
| ## Add the project to the continuous integration pipeline | ||
|
|
||
| To run the tests of all projects in parallel, the projects are explicitly mentioned in the CI-file. | ||
| In order to run the tests of your project, please add the name of your project **as your directory is named** | ||
| in the [CI-File](<https://github.com/Parallel-in-Time/pySDC/blob/master/.github/workflows/ci_pipeline.yml>) | ||
| in the job `project_cpu_tests_linux` in the list `strategy/matrix/env`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, we need to make sure that this is correct in the end. If we decide to use the. pytest markers (I vote we do) we need to detail here how to add you own.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgot to actually submit the following comment yesterday afternoon:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the markers because they assign the tests to the respective environments in a very explicit way. But I can see that we disagree on this issue. @pancetta, please note your preference and we'll go with that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The markers were used originally because we wanted to filter the tests by a certain property. Adding new ones is pretty clumsy and forgetting to set a marker was also easily possible. So, if we don't need markers, we should get rid of them. But if we need to do other filter magic instead, we should keep them. So, what would happen if we drop markers?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In any case, we should not mix markers and non-markers. If we decide to use markers, we should only use markers. If we decide to get rid of markers, we should get fully rid of them.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jakob currently set things up so that the project tests are in the project folders and the pipeline just runs all tests in a project folder with the environment file in the same folder. The remaining tests are still in the separate tests directory and use the markers
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to avoid confusion: We can get rid of all markers within the tests for projects. But currently we still use pytest-markers for all tests outside of projects. I wanted to explicitly state that as it slightly contradicts the statement of @pancetta about using markers everywhere or nowhere.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we did introduce inconsistencies here, too (see also my other comment below).
jakob-fritz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Getting a DOI of pySDC for publication | ||
|
|
||
| If your project is published and you need a dedicated pySDC version with a DOI, please get in touch with us and/or open a new issue. | ||
| We will help you with this as soon as possible. | ||
| Note that a final DOI is usually only necessary once a paper is accepted and the final proofs are due. | ||
| We strongly encourage to describe and cite the current version of pySDC already during initial submission, though. | ||
|
|
||
| :arrow_left: [Back to Documenting Code](./05_documenting_code.md) --- | ||
| :arrow_up: [Contributing Summary](./../../CONTRIBUTING.md) --- | ||
| :arrow_right: [Next to a cute picture of cat](https://www.vecteezy.com/photo/2098203-silver-tabby-cat-sitting-on-green-background) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,3 @@ dependencies: | |
| - mpich | ||
| - petsc4py<3.20 | ||
| - mpi4py>=3.0.0 | ||
| - pytest | ||
| - pytest-cov | ||
| - pytest-timeout | ||
| - pytest-order | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - coverage[toml] | ||
| - sphinx | ||
| - numpy | ||
| - scipy | ||
| - matplotlib | ||
| - dill | ||
| - numba |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - pytest | ||
| - pytest-benchmark | ||
| - pytest-timeout | ||
| - pytest-order | ||
| - coverage[toml] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - mpi4py>=3.0.0 | ||
| - mpi4py-fft>=2.0.2 | ||
| - matplotlib>=3.0 | ||
| - dill>=0.2.6 | ||
| - scipy>=0.17.1 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - matplotlib>=3.0 | ||
| - scipy>=0.17.1 | ||
| - dill>=0.2.6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - numpy | ||
| - scipy>=0.17.1 | ||
| - dill>=0.2.6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - numpy | ||
| - matplotlib>=3.0 | ||
| - scipy>=0.17.1 | ||
| - sympy>=1.0 | ||
| - dill>=0.2.6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - dill>=0.2.6 | ||
| - numpy | ||
| - matplotlib>=3.0 | ||
| - scipy>=0.17.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - numpy | ||
| - scipy>=0.17.1 | ||
| - dill>=0.2.6 | ||
| - matplotlib>=3.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - numpy | ||
| - dill>=0.2.6 | ||
| - scipy>=0.17.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - mpi4py>=3.0.0 | ||
| - mpi4py-fft>=2.0.2 | ||
| - mpich | ||
| - matplotlib>=3.0 | ||
| - dill>=0.2.6 | ||
| - scipy>=0.17.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| name: pySDC | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| dependencies: | ||
| - petsc4py<3.20 | ||
| - matplotlib>=3.0 | ||
| - dill>=0.2.6 | ||
| - scipy>=0.17.1 |
Uh oh!
There was an error while loading. Please reload this page.