mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
bc4456eccc
At the moment we can... ...run tests in isolation, generating coverage report: $ dev.sh test You can pass args to pytest as well. e.g. to run a specific test: $ dev.sh test -k "test_jsonb_has_all" Launch a postgres container with useful dev defaults, with PostGIS, cleaning up afterwards: $ dev.sh postgres Build and launch graphql-engine in dev mode, connecting with a `postgres` launched above $ dev.sh graphql-engine
19 lines
630 B
Python
19 lines
630 B
Python
#!/usr/bin/env python3
|
|
|
|
import pytest
|
|
import re
|
|
|
|
|
|
class TestServerVersion(object):
|
|
|
|
def test_version(self, hge_ctx):
|
|
resp = hge_ctx.http.get(
|
|
hge_ctx.hge_url + '/v1/version'
|
|
)
|
|
my_json = resp.json()
|
|
# The tree may be dirty because we're developing tests locally while
|
|
# graphql-engine was built previously when tree was clean. If we're
|
|
# modifying graphql-engine too then both of these will be tagged dirty,
|
|
# since a rebuild would necessarily be forced:
|
|
assert my_json['version'] in (hge_ctx.version, re.sub('-dirty$', '', hge_ctx.version)), my_json
|