-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unit tests #3
Merged
Merged
Unit tests #3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5400895
to
25c576b
Compare
szabo137
pushed a commit
to QEDjl-project/QuantumElectrodynamics.jl
that referenced
this pull request
Jul 10, 2023
The PR add the tool SetupEnv and enable unit testing for QED.jl. # About SetupEnv `SetupEnv` creates an environment for the unit tests. It reads the `Project.toml` of the project and installs all QED dependencies as development version from the current `dev` branch by default. All other dependencies are normally installed. `SetupEnv` also allows to install QED dependencies from other repositories and branches. - On a local system, you can set the environment variable `CI_UNIT_PKG_URL_<QED_package>=https://github.com/User/<QED_package>#<branch>`. For example, if I want to use my fork of `QEDbase` and the feature branch `fooFunction` I have to set the environment variable `CI_UNIT_PKG_URL_QEDbase=https://github.com/SimeonEhrig/QEDbase.jl.git#fooFunction`. - In the CI, the dependency can set via commit message: Example Git commit message: ``` Add function bar - function bar uses the function foo from the QEDbase packge CI_UNIT_PKG_URL_QEDbase: https://github.com/SimeonEhrig/QEDbase.jl.git#fooFunction ``` # Pipeline behavior The pipeline has two stages for unit test. The first stage does the actual unit tests. If the stages passes, you code is fine. The second stage checks, if `SetupEnv` use custom URLs for QED packages. If this happens, the test will fail. The reason is, that no code should be merged, which rely on non merged functions. The solution is merging the code in the depending package first and than trigger the CI with `CI_UNIT_PKG_URL_<package>` in the message again. # Local unit tests Local unit tests are enable in the `.gitlab-ci.yml`. Actual `QED.jl` will not have functionality, but with the unit tests, we can test the functionality of the `SetupEnv`. # unit testing in sub packages Sub packages needs to clone this repository to get the `SetupEnv` tool, see QEDjl-project/QEDfields.jl#3 # Documentation Documentation is coming, when the integration tests are implement. I decided to split up the unit and integration tests in two separate PR for better review. Compare to it, it is better to write the documentation of the unit and integration test together. So, the unit test documentation is coming together with the integration test PR. A initial version can be found here: https://github.com/SimeonEhrig/GitlabCIMain/blob/master/docs/src/index.md
a9e9959
to
096a3b3
Compare
- use SetupDevEnv.jl script from QED.jl repository to setup test environment
096a3b3
to
3a85bc0
Compare
@szabo137 ready for review |
szabo137
approved these changes
Aug 21, 2023
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 for this PR.
No concerns from my side.
ready for merging!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Setup CI for unit tests. Use
SetupDevEnv.jl
project to setup test environment. The script setups all QED dependencies to the currentdev
branch.