You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:54:45 UTC

[buildstream] 03/08: Get plugins to test in bst CI

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch coldtom/external-plugins
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit ea374960a2bcd798f288ee030ebc4d627e94c582
Author: Thomas Coldrick <th...@codethink.co.uk>
AuthorDate: Mon Sep 16 16:30:35 2019 +0100

    Get plugins to test in bst CI
---
 tests/conftest.py |  7 +++++++
 tox.ini           | 27 +++++++++++++++++++--------
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index 68fdba7..a1ca97f 100755
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -51,6 +51,9 @@ def pytest_addoption(parser):
     parser.addoption('--remote-execution', action='store_true', default=False,
                      help='Run remote-execution tests only')
 
+    parser.addoption('--external-plugins', action='store_true', default=False,
+                     help="Run standardised tests for external plugins")
+
 
 def pytest_runtest_setup(item):
     # Without --integration: skip tests not marked with 'integration'
@@ -138,6 +141,10 @@ register_repo_kind('zip', Zip, None)
 def pytest_sessionstart(session):
     sourcetests_collection_hook(session)
 
+    if session.config.getvalue('external_plugins'):
+        import bst_plugins_experimental
+        bst_plugins_experimental.testutils.register_sources()
+
 
 #################################################
 #             Isolated environment              #
diff --git a/tox.ini b/tox.ini
index 309e0cc..ce36da9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,24 +15,32 @@ isolated_build = true
 usedevelop =
     # This is required by Cython in order to get coverage for cython files.
     py{35,36,37}-!nocover: True
+    plugins: True
 
 commands =
     # Running with coverage reporting enabled
-    py{35,36,37}-!external-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
+    py{35,36,37}-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
     py{35,36,37}-!nocover: mkdir -p .coverage-reports
-    external-!nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} --cov=buildstream --cov-append {posargs}
-    py{35,36,37}-!external-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
-    py{35,36,37}-external-!nocover: - mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
+    py{35,36,37}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
     # Running with coverage reporting disabled
-    py{35,36,37}-!external-nocover: pytest --basetemp {envtmpdir} {posargs}
-    external-nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} {posargs}
+    py{35,36,37}-nocover: pytest --basetemp {envtmpdir} {posargs}
+
+    plugins: pytest --basetemp {envtmpdir} --external-plugins {posargs}
+
+   
 deps =
     py{35,36,37}: -rrequirements/requirements.txt
     py{35,36,37}: -rrequirements/dev-requirements.txt
     py{35,36,37}: -rrequirements/plugin-requirements.txt
+    
+    plugins: -rrequirements/requirements.txt
+    plugins: -rrequirements/dev-requirements.txt
+    plugins: -rrequirements/plugin-requirements.txt
+    plugins: git+https://gitlab.com/buildstream/bst-plugins-experimental@coldtom/setup-py-improvements
+
 
     # Only require coverage and pytest-cov when using it
-    !nocover: -rrequirements/cov-requirements.txt
+    py{35,36,37}-!nocover: -rrequirements/cov-requirements.txt
 passenv =
     ARTIFACT_CACHE_SERVICE
     BST_FORCE_BACKEND
@@ -65,7 +73,10 @@ whitelist_externals =
     py{35,36,37}:
         mv
         mkdir
-
+    plugins:
+        rm
+        mv
+        git
 #
 # Coverage reporting
 #