From 7ba47bfd2da844911c67d16bca6574cc449422a5 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Sun, 8 Jan 2017 16:21:13 -0800 Subject: [PATCH] Correct test constraints and add sanity check. --- test/runner/requirements/constraints.txt | 1 + test/runner/requirements/integration.txt | 2 +- test/sanity/code-smell/test-constraints.sh | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 test/sanity/code-smell/test-constraints.sh diff --git a/test/runner/requirements/constraints.txt b/test/runner/requirements/constraints.txt index ec8e8a069b..bafc23867f 100644 --- a/test/runner/requirements/constraints.txt +++ b/test/runner/requirements/constraints.txt @@ -1,2 +1,3 @@ coverage >= 4.2 +jinja2 < 2.9 # 2.9 introduces changes which break tests pywinrm >= 0.2.1 # 0.1.1 required, but 0.2.1 provides better performance diff --git a/test/runner/requirements/integration.txt b/test/runner/requirements/integration.txt index 9f059da5a3..84ca1ec94a 100644 --- a/test/runner/requirements/integration.txt +++ b/test/runner/requirements/integration.txt @@ -1,4 +1,4 @@ -jinja2<2.9 +jinja2 jmespath junit-xml ordereddict ; python_version < '2.7' diff --git a/test/sanity/code-smell/test-constraints.sh b/test/sanity/code-smell/test-constraints.sh new file mode 100755 index 0000000000..0bbaad53b0 --- /dev/null +++ b/test/sanity/code-smell/test-constraints.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +constraints=$( + grep '.' test/runner/requirements/*.txt \ + | sed 's/ *;.*$//; s/ #.*$//' \ + | grep -v '/constraints.txt:' \ + | grep '[<>=]' +) + +if [ "${constraints}" ]; then + echo 'Constraints for test requirements should be in "test/runner/requirements/constraints.txt".' + echo 'The following constraints were found outside the "constraints.txt" file:' + echo "${constraints}" + exit 1 +fi