Network access during unit tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
TOSCA Parser |
New
|
Medium
|
Unassigned |
Bug Description
Hi. Building the tosca-parser package in Debian, we also run unit tests. Unfortunately, a number of them are doing network access, for example downloading stuff from github. This is by definition forbidden in the Debian policy, so I had to patch them out.
To make sure there is no network access, I'm also setting-up environment variables:
export http_proxy=
export https_proxy=
export HTTP_PROXY=
export HTTPS_PROXY=
export RES_OPTIONS=
This is the normal way to disable network in the debian/rules file.
What would be great was if the tosca-parser unit test suite could detect the above environment variable, and if they are present, just don't run these unit tests that are doing network access. Indeed, having Debian specific patches to maintain is painful on each new upstream release. This could easily be done using function decorators (skipIf...). For example, using testtools, something like this could be done:
@testtools.
Please consider doing this, this would really be helpful for downstream package maintainers.
Cheers,
Thomas Goirand (zigo)
Changed in tosca-parser: | |
importance: | Undecided → Medium |
I forgot to post the list of unit test with problems. Here it is:
test_prereq. CSARPrereqTest. test_url_ is_zip CSARPrereqTest. test_csar_ invalid_ import_ url CSARPrereqTest. test_valid_ csar_with_ url_import_ and_script ToscaTemplateTe st.test_ repositories_ definition ToscaTemplateTe st.test_ csar_parsing_ elk_url_ based ToscaTemplateTe st.test_ local_template_ with_url_ import ToscaTemplateTe st.test_ repositories ToscaTemplateTe st.test_ yaml_dict_ tpl_with_ params_ and_url_ import ToscaTemplateTe st.test_ url_template_ with_local_ relpath_ import ToscaTemplateTe st.test_ url_template_ with_url_ import ToscaTemplateTe st.test_ url_template_ with_local_ abspath_ import lidation. ToscaTemplateVa lidationTest. test_imports_ file_namespace_ fields lidation. ToscaTemplateVa lidationTest. test_imports_ without_ import_ name lidation. ToscaTemplateVa lidationTest. test_imports_ duplicate_ name lidation. ToscaTemplateVa lidationTest. test_imports_ wth_import_ name lidation. ToscaTemplateVa lidationTest. test_imports_ file_with_ uri
test_prereq.
test_prereq.
test_toscatpl.
test_toscatpl.
test_toscatpl.
test_toscatpl.
test_toscatpl.
test_toscatpl.
test_toscatpl.
test_toscatpl.
test_toscatplva
test_toscatplva
test_toscatplva
test_toscatplva
test_toscatplva