Skip to content

Develop codacy test #1667

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

Merged
merged 21 commits into from
Mar 22, 2019
Merged

Develop codacy test #1667

merged 21 commits into from
Mar 22, 2019

Conversation

xiaomaogy
Copy link
Contributor

No description provided.

@xiaomaogy
Copy link
Contributor Author

xiaomaogy commented Feb 1, 2019

@mmattar Since you setup the Codacy before, it would be better you could change these on your end. (Or we could change this when I get back. )

This PR is just a demo of what needs to be changed.

  1. .circleci/config.yml change, this is to generate the python test coverage report, and send the generated coverage.xml report to the codacy.

  2. In order for the python-codacy-coverage -r coverage.xml to work, you need to add the Project_Token to the circle ci environment variable. refer to https://github.com/codacy/python-codacy-coverage#setup.

  3. The change in the README.md shows how to add the current code quality and code coverage numbers to the front page. We might not want to show it there, but this is just to show how it looks like.

https://github.com/Unity-Technologies/ml-agents/blob/e09564dc78e61d2c9f15fc08637bd90cd658d9be/README.md

  1. I looked into the Codacy setup, we might want to change the Code patterns setup in the codacy, so that only pylint is turned on.

Vince and I looked at the code analysis of Sonar C#, and the issues this tool raises isn't exactly what we want, so we might want to turn it off until we find another better tool to do the C# code analysis.

After this Code Patterns setup (Turning on Pylint, Remark Lint for markdown), this is the list of issues that are raised on this branch, which are much more reasonable. https://app.codacy.com/app/xiaomaogy/ml-agents/files?bid=11067808

@@ -37,7 +37,9 @@
'docopt',
'pyyaml',
'protobuf>=3.6,<3.7',
'grpcio>=1.11.0,<1.12.0'],
'grpcio>=1.11.0,<1.12.0',
'pytest-cov==2.6.1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of think the end user should not have to install those. Ideally, these last 2 requirements will be line 34 of .circleci/config.yml as pip install ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

README.md Outdated
@@ -4,6 +4,12 @@

# Unity ML-Agents Toolkit (Beta)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2917c303f7fd46a68f0531edfad44434?branch=develop-codacy-test)](https://www.codacy.com/app/xiaomaogy/ml-agents?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Unity-Technologies/ml-agents&amp;utm_campaign=Badge_Grade)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @xiaomaogy said in his comment, we probably don't want this here. Is it possible to have this badge be either on a separate branch, a separate repo or even be only on slack ?

Copy link
Contributor Author

@xiaomaogy xiaomaogy Feb 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is possible to have this badge on a separate branch (or a separate repo).

If we put this on for example develop branch, when we merge it we need to manually remove it, which is not desired.

If we put this on other branches, we would need to sync all of the code changes to both the develop branch and this other branch.

We could also put this on slack. It is just a link so we can just put it anywhere we want as long as we remember to check it.

Also codacy has this nice feature of analyzing every PR's code change, to track the code quality change according to its standard. (https://app.codacy.com/app/marwan/ml-agents/pullRequest?prid=3010293)

@xiaomaogy xiaomaogy requested a review from awjuliani March 20, 2019 01:34
@xiaomaogy
Copy link
Contributor Author

@xiaomaogy xiaomaogy force-pushed the develop-codacy-test branch from 476f013 to 925b044 Compare March 22, 2019 18:11
…der, so that it covers gym_unity’s pytest also
@xiaomaogy xiaomaogy merged commit 2c4a493 into develop Mar 22, 2019
@xiaomaogy xiaomaogy deleted the develop-codacy-test branch March 22, 2019 18:58
LeSphax pushed a commit to LeSphax/ml-agents-1 that referenced this pull request May 3, 2020
* fixed the test break on pytest > 4.0, added the pytest cov

* added the pytest-cov package

* added the logic to upload coverage.yml report to codacy

* remove the warning message in during the pytest

* added the codacy badge to show what it looks like

* added a space

* removed the space

* removed the duplicate pytest

* removed the extra spaces

* added the test coverage badge

* point the badge to the test branch

* changed

* moved the python test coverage to circleci

* removed the badge

* added the badge

* fixed the link

* Added the gym_unity test to the circleci

* Fixed the gym_unity installation

* Changed the test-reports from the ml-agents subfolder to the root folder, so that it covers gym_unity’s pytest also
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants