Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

//:test-integration now depends on @graknlabs_grakn_core//:assemble-mac-zip #39

Merged
merged 7 commits into from
Apr 4, 2019
Merged

//:test-integration now depends on @graknlabs_grakn_core//:assemble-mac-zip #39

merged 7 commits into from
Apr 4, 2019

Conversation

vmax
Copy link
Contributor

@vmax vmax commented Apr 3, 2019

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?

  • tests now depend on @graknlabs_grakn_core//:assemble-mac-zip via data
  • tests now unpack/start/stop Grakn before executing

unittest.main()


with GraknDistribution():
Copy link
Member

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):
Copy link
Member

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

def __exit__(self, exc_type, exc_val, exc_tb):
self.stop()

def start(self):
Copy link
Member

@lolski lolski Apr 3, 2019

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:

Suggested change
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

self._unpack()
sp.check_call([
'grakn', 'server', 'start'
], cwd=self.__grakn_root_directory)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well

def stop(self):
sp.check_call([
'grakn', 'server', 'stop'
], cwd=self.__grakn_root_directory)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@lolski lolski merged commit e6e99d1 into typedb:master Apr 4, 2019
@vmax vmax deleted the integration-test-dep-on-distribution branch April 4, 2019 11:21
@haikalpribadi haikalpribadi added this to the 1.5.2 milestone Apr 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update //:test_integration to work with RBE
3 participants