-
Notifications
You must be signed in to change notification settings - Fork 24
//:test-integration now depends on @graknlabs_grakn_core//:assemble-mac-zip #39
//:test-integration now depends on @graknlabs_grakn_core//:assemble-mac-zip #39
Conversation
tests/integration/test_concept.py
Outdated
unittest.main() | ||
|
||
|
||
with GraknDistribution(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we call it GraknServer
? since this isn't just a distribution, but rather a fully started Grakn instance
def __grakn_root_directory(self): | ||
return os.path.join(self.__unpacked_dir, GraknDistribution.DISTRIBUTION_ROOT_DIR) | ||
|
||
def __enter__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we've discussed over Slack, let's combine start
with __enter__
and stop
with __exit__
. __enter__
and __exit__
are just one liners so there isn't much sense in splitting them
tests/integration/base.py
Outdated
def __exit__(self, exc_type, exc_val, exc_tb): | ||
self.stop() | ||
|
||
def start(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we get rid of __grakn_root_directory
and compute cwd
directly:
def start(self): | |
def start(self): | |
... | |
sp.check_call([ | |
'grakn', 'server', 'start' | |
], cwd=os.path.join(self.__unpacked_dir, DISTRIBUTION_ROOT_DIR)) |
I think @property
adds an unnecessary noise to the code, especially considering most of us here aren't Python programmers
tests/integration/base.py
Outdated
self._unpack() | ||
sp.check_call([ | ||
'grakn', 'server', 'start' | ||
], cwd=self.__grakn_root_directory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well
tests/integration/base.py
Outdated
def stop(self): | ||
sp.check_call([ | ||
'grakn', 'server', 'stop' | ||
], cwd=self.__grakn_root_directory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
What is the goal of this PR?
Test should unpack, start/stop Grakn distribution within the test
Closes #2
What are the changes implemented in this PR?
@graknlabs_grakn_core//:assemble-mac-zip
viadata