Skip to content

Commit 8f1673d

Browse files
committed
Fix pytest error on Travis.
Signed-off-by: Johnathan Garrett <jd@prominentedge.com>
1 parent e5a3895 commit 8f1673d

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.utility/run-python-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ source ./tests-venv/bin/activate
1919
pip install wheel
2020
pip install -r requirements.txt
2121

22+
mvn -Dexec.executable=echo -Dexec.args='${project.version}' -f ../../../.. --non-recursive exec:exec
2223
pytest --cov-report= --cov=pygw pygw/test/
2324
EXIT_CODE=$?
2425

python/src/main/python/maven_version.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111

1212
def get_maven_version():
1313
version = subprocess.check_output([
14-
"mvn", "-q", "-Dexec.executable=echo", "-Dexec.args='${project.version}'", "-f", "../../..", "exec:exec"
14+
"mvn", "-q", "-Dexec.executable=echo", "-Dexec.args='${project.version}'", "-f", "../../../..", "--non-recursive", "exec:exec"
1515
]).strip().decode().replace("-", ".")
1616
if ("SNAPSHOT" in version):
17-
git_description = subprocess.check_output(["git", "describe"]).strip().decode()
18-
dev_count = re.search("-(.*)-", git_description).group(1)
17+
git_description = subprocess.check_output(["git", "describe", "--always"]).strip().decode()
18+
count_search = re.search("-(.*)-", git_description)
19+
if (count_search is not None):
20+
dev_count = count_search.group(1)
21+
else:
22+
dev_count = "0"
1923
version = version.replace("SNAPSHOT", "dev" + dev_count)
2024
return version.lower()

0 commit comments

Comments
 (0)