-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tox + code coverage #150
Tox + code coverage #150
Conversation
bump pip requirements versions (microsoft#104)
commit 3ba351c Author: Alexandre Gattiker <algattik@users.noreply.github.com> Date: Sat Jan 25 08:37:53 2020 +0100 . commit 5c3c3e0 Author: Alexandre Gattiker <algattik@users.noreply.github.com> Date: Sat Jan 25 07:58:50 2020 +0100 . commit 2a49221 Author: Alexandre Gattiker <algattik@users.noreply.github.com> Date: Sat Jan 25 07:24:37 2020 +0100 . Merge remote-tracking branch 'upstream/master' into algattik/code-coverage
docs/development_setup.md
Outdated
Install the required Python modules in your virtual environment. | ||
|
||
``` | ||
pip install -r environment_setup/build-image/requirements.txt |
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.
requirements.txt is in environment_setup folder
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.
It should be "pip install -r environment_setup/requirements.txt"
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.
Fixed, apologies
environment_setup/Dockerfile
Outdated
# Install Python modules | ||
COPY requirements.txt /setup/ | ||
RUN pip install --upgrade -r /setup/requirements.txt |
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.
Consider reducing the number of image layers by combining RUN commands.
"squash" option is still experimental.
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.
Updated to reduce RUN steps
The build fails with "No code coverage results were found to publish." |
The mlopspython image must first be updated as there are new dependencies. |
Updated with changes from master |
environment_setup/Dockerfile
Outdated
# Install dotnet runtime used to generate code coverage report | ||
RUN curl -O https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb \ | ||
&& dpkg -i packages-microsoft-prod.deb \ | ||
&& apt-get update && apt-get install -y dotnet-runtime-3.1 |
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.
Do we really need dotnet-runtime-3.1
? I assume code coverage will still show up in Azure DevOps, but we'll just get the warning of no auto-generated html reports, no?
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.
Without dotnet runtime we only get the report as an artifact.
With dotnet runtime we get an an embedded HTML report
this can be achieved by:
- Adding dotnet runtime to mlopsython container, is an additional 104 MB installation.
- install dotnet at pipeline execution time.
Given the impact of 1 or 2 in terms of build time and the limited benefit of the embedded report, I will update the PR to go for neither option.
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.
Another idea would be to add 2. commented out in the pipeline if people want to enable the code coverage html report
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.
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.
👌
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.
Fixed. There is no update to the Dockerfile anymore, but the mlopspython image must still be rebuilt because of updates to requirements.txt.
I tested installing dotnet core but coverage report generation then fails with a missing libicu library, and sudo is not available to install it. I suggest investigating this at a later point.
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.
David Tesar's comment:
"Do we really need dotnet-runtime-3.1? I assume code coverage will still show up in Azure DevOps, but we'll just get the warning of no auto-generated html reports, no?"
After we merge #158 we should be able to add instructions for enabling report generation:
|
Changes:
flake8
andpytest
withintox
.Added code coverage report. Required adapted
pytest
commandline (now intox.ini
) and installing .NET Core as for security reasons, the AzDO PublishCodeCoverageResults does not publish user-generated HTML reports anymore.Linting fixes in some
.py
scripts to avoid CI build failing.Some simplifications in the build pipeline YAML.