-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added new test infrastructure #29
Conversation
Nice! I'll get to this once the tests pass. |
The tests are failing because the git initialisation hooks are not added yet, I left it out since this PR was getting too long and was thinking of making a new PR for the hooks, do you want me to add them in this same PR? |
I think it would be better to create and merge a PR for git initialization before this PR goes in/is reviewed. |
The tests are now passing after the git initialisation hooks are merged, I will be adding the patch as I mentioned here to flag out the |
{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Agriya Khetarpal <[email protected]>
...ookiecutter.__project_slug}}/{% if cookiecutter.backend == "hatch" %}_version.pyi{% endif %}
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/version.py
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/__init__.py
Outdated
Show resolved
Hide resolved
…g}}/{% if cookiecutter.backend == "hatch" %}_version.pyi{% endif %} Co-authored-by: Saransh Chopra <[email protected]>
...}}/src/{{cookiecutter.__project_slug}}/{% if cookiecutter.hatch_vcs %}_version.py{% endif %}
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/.github/workflows/test_on_push.yml
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/.github/workflows/test_on_push.yml
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/.github/workflows/test_on_push.yml
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/.github/workflows/test_on_push.yml
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/.github/workflows/test_on_push.yml
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py
Outdated
Show resolved
Hide resolved
{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Agriya Khetarpal <[email protected]>
1c7e057
to
e2e2896
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a small comment about the test duplication.
{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @santacodes, overall looks good.
Some minor suggestions. Should be good to merge after one final review from @Saransh-cpp.
Co-authored-by: Arjun Verma <[email protected]>
{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/__init__.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Saransh Chopra <[email protected]>
Co-authored-by: Saransh Chopra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @santacodes! This looks great now!
This is a follow-up on PR #29, the template has been completely migrated to `copier`.
Separated
nox sessions
insideproject
andtemplate
.project
:project-tests
tests the units inside thepybamm_cookiecutter
project, andtemplate-tests
tests thecookiecutter template
for a proper generation.template
: once a user generates a project (lets call it agenerated project
), thegenerated project
has twonox sessions
for the tests,generated-project-tests
which tests all the units inside thegenerated project
anduser-tests
which executes the test cases added by a user for their respective code.CI job to test the
generated project
generated project
is added in the workflow, which generates a project using the cookiecutter template and runs the tests contained in thegenerated project
to test if theentry points
and other units are working as intended.doctests
andcoverage
.Note
The tests running inside
generated project
will fail at the last step as a hook is yet to be configured to initialisegit
inside the template using apost_gen_project
script, I thought this PR was getting too long to be reviewed so I left that out for a separate one. Also I usedpipx
to run the tests inside thegenerated project
because nox wasn't working when changing the working directory to thegenerated project
.Subtask #26