summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-10-04 20:56:15 +0300
committerLars Wirzenius <liw@liw.fi>2017-10-04 20:56:15 +0300
commit8d78f902b6eba4326fccd0c710c286370bf26746 (patch)
tree33ed1aaf6ed38c371e6eb22a0208ce44a629ad56 /yarns
parentf065856c67dcd8e6c88cfa454fe2596c024284f4 (diff)
downloadick2-8d78f902b6eba4326fccd0c710c286370bf26746.tar.gz
Add: make yarn get version from setup.py
Hardcoding it would just mean having to update it after every release, and ain't nobody ready to do that.
Diffstat (limited to 'yarns')
-rw-r--r--yarns/200-version.yarn2
-rw-r--r--yarns/900-implements.yarn7
2 files changed, 8 insertions, 1 deletions
diff --git a/yarns/200-version.yarn b/yarns/200-version.yarn
index 92cccbb..5fa08ed 100644
--- a/yarns/200-version.yarn
+++ b/yarns/200-version.yarn
@@ -30,6 +30,6 @@ The Ick controller reports is version upon request.
WHEN user makes request GET /version
THEN result has status code 200
- AND body matches { "version": "0.2.1+git" }
+ AND version in body matches version from setup.py
FINALLY stop ick controller
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index 0a0818c..71461e8 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -150,6 +150,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
actual = json.loads(vars['body'])
assertEqual(expected, actual)
+ IMPLEMENTS THEN version in body matches version from setup.py
+ body = vars['body']
+ obj = json.loads(body)
+ actual = obj['version']
+ setup_py = os.path.join(srcdir, 'setup.py')
+ wanted = cliapp.runcmd(['python3', setup_py, '--version']).strip()
+ assertEqual(actual, wanted)
## Controller state inspection