Repository: https://gitlab.com/nanuchi/mynodeapp-cicd-project
Test report is a useful thing to use in my current work.
It starts at 3:20 in the video
In the app used as an example, the tests generate a junit.xml
file that can be parsed by GitLab and show as a report in the web interface.
To show the report generated by the jest-junit in the gitlab we need to add this to our .gitlab-ci.yml
:
# ...
run_unit_tests:
# ...
artifacts:
when: always
reports:
junit: app/junit.xml
Another useful thing about these reports in the GitLab's UI is in the Merge Requests page. It shows the tests that failed.
Issues I faced when implementing this at my work:
--format junit
artifacts:reports
(e.g.: junit-eslint-start-e2e.xml
).xml
file (like this one described here), and it made me give up from using this kind of report ☹️I've learned that gitlab.com provides a private registry for your docker image.
I also noticed that the self-hosted GitLab doesn't have this option (at least not by default).
This is also cool to have in my work.
# ...
deploy_to_dev:
# ...
environment:
name: development
url: http://dev.server.com:3000
Does docker-compose
automatically replace references to ${VARIABLES}
in the file's contents with the value of the respective environment variables?