-
Notifications
You must be signed in to change notification settings - Fork 63
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
AEA-1189 Crypto plug-in mechanism #2112
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2112 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 301 299 -2
Lines 24240 23578 -662
==========================================
- Hits 24240 23578 -662
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
5a521b9
to
4fbe9e3
Compare
4fbe9e3
to
2e51f6a
Compare
39bcbb9
to
cc23765
Compare
cc23765
to
1ca8c0c
Compare
removed as it turned out to be useless
Error: "There are no .py[i] files in directory 'plugins'"
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.
The tests should be collocated to the plugins
7a47feb
to
667c981
Compare
[plugins] | ||
commands = | ||
python -m pip install --no-deps file://{toxinidir}/plugins/aea-crypto-ethereum | ||
python -m pip install --no-deps file://{toxinidir}/plugins/aea-crypto-cosmos | ||
python -m pip install --no-deps file://{toxinidir}/plugins/aea-crypto-fetchai | ||
pytest -rfE plugins/aea-crypto-fetchai/tests --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_crypto_fetchai --cov-config=.coveragerc --suppress-no-test-exit-code {posargs} | ||
pytest -rfE plugins/aea-crypto-ethereum/tests --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_crypto_ethereum --cov-config=.coveragerc --suppress-no-test-exit-code {posargs} | ||
pytest -rfE plugins/aea-crypto-cosmos/tests --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov=aea_crypto_cosmos --cov-config=.coveragerc --suppress-no-test-exit-code {posargs} | ||
|
||
[testenv:plugins-py3.6] | ||
basepython = python3.6 | ||
commands = {[plugins]commands} | ||
|
||
[testenv:plugins-py3.7] | ||
basepython = python3.7 | ||
commands = {[plugins]commands} | ||
|
||
[testenv:plugins-py3.7-cov] | ||
basepython = python3.7 | ||
usedevelop = True | ||
commands = {[plugins]commands} | ||
|
||
[testenv:plugins-py3.8] | ||
basepython = python3.8 | ||
commands = {[plugins]commands} | ||
|
||
[testenv:plugins-py3.9] | ||
basepython = python3.9 | ||
commands = {[plugins]commands} | ||
|
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 feel this might still be improved, as the "main testenv" above, still good enough.
@@ -356,6 +356,9 @@ jobs: | |||
name: Unit tests | |||
run: | | |||
tox -e py${{ matrix.python_version }} -- -m 'not integration and not unstable' | |||
- name: Plugin tests | |||
run: | | |||
tox -e plugins-py${{ matrix.python_version }} -- --cov-append -m 'not integration and not unstable' |
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.
note --cov-append
. An alternative is to generate different coverage file for each plugin and then merge with coverage combine
:
https://coverage.readthedocs.io/en/latest/cmd.html#cmd-combine
.github/workflows/workflow.yml
Outdated
run: tox -e py3.7-cov -- --ignore=tests/test_docs --ignore=tests/test_examples --ignore=tests/test_packages/test_contracts --ignore=tests/test_packages/test_skills_integration -m 'not unstable' | ||
run: | ||
tox -e py3.7-cov -- --ignore=tests/test_docs --ignore=tests/test_examples --ignore=tests/test_packages/test_contracts --ignore=tests/test_packages/test_skills_integration -m 'not unstable' | ||
tox -e py3.7-cov -- --cov-append -m 'not unstable' |
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.
see --cov-append
@@ -0,0 +1,201 @@ | |||
Apache License | |||
Version 2.0, January 2004 |
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.
Can we not point to root license from Manifest file?
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.
yes
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.
sorry, 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.
but we could add a check that make sure the LICENSE is the same
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.
Ok, let's worry about these checks separately (new PR)...there are a few 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.
done in 8af620f
# -*- coding: utf-8 -*- | ||
# ------------------------------------------------------------------------------ | ||
# | ||
# Copyright 2018-2019 Fetch.AI Limited |
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.
Why does this not show relative changes?
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.
because we have another file in tests/test_crypto/test_ethereum.py
.
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.
What's in the other one? Why is not everything here?
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.
a test on an ethereum contract
; because we use --no-deps to install the plugins. | ||
; aea_crypto_cosmos/aea_crypto_fetchai |
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.
Why the no deps install?
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.
because we want to test the plugins with the aea
on develop
(installed by tox during env setup), not from PyPI.
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.
True that!
@@ -25,22 +25,16 @@ | |||
from unittest.mock import MagicMock, patch |
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.
@DavidMinarsch now diffs work :-)
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.
Why do we have mentions of the crypto plugins as constants in aea?
Do we need to load all the plugins on aea module load?
@@ -100,6 +105,7 @@ jobs: | |||
sudo apt-get autoremove | |||
sudo apt-get autoclean | |||
pip install tox | |||
pip install --user --upgrade setuptools |
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.
pip and setuptools always show a warning that can be updated.
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.
LGTM
in workflow, coverage_checks: - missing '|' - plugin-py3.7-cov test environment should have been called, instead of py3.7-cov.
AEA-1189 Fixes to Crypto plugin PR #2112
Proposed changes
This PR introduces the plug-in mechanism proposed in #1229 for Cryptos.
Fixes
Addresses #1229
Types of changes
What types of changes does your code introduce to agents-aea?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.develop
branch (left side). Also you should start your branch off ourdevelop
.aea cli
tool worksFurther comments
n/a