Repository navigation
updates to re-enable pytest test harness #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| import unittest | ||
| import subprocess, os, signal | ||
| from context import arkouda as ak | ||
| from util.test.util import start_arkouda_server, stop_arkouda_server, get_arkouda_numlocales | ||
| from util.test.util import get_arkouda_server, get_arkouda_numlocales,\ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused |
||
| start_arkouda_server, stop_arkouda_server | ||
|
|
||
| ''' | ||
| ArkoudaTest defines the base Arkouda test logic for starting up the arkouda_server at the | ||
|
|
@@ -13,26 +14,24 @@ | |
| ''' | ||
| class ArkoudaTest(unittest.TestCase): | ||
|
|
||
| verbose = bool(os.getenv('ARKOUDA_VERBOSE', 'False')) | ||
| port = os.getenv('ARKOUDA_SERVER_PORT') | ||
| server = os.getenv('ARKOUDA_SERVER_HOST') | ||
|
|
||
| port_server_set = port != None and server != None | ||
| full_stack_mode = bool(os.getenv('ARKOUDA_FULL_STACK_TEST', not port_server_set)) | ||
| verbose = True if os.getenv('ARKOUDA_VERBOSE') == 'True' else False | ||
| port = int(os.getenv('ARKOUDA_SERVER_PORT', 5555)) | ||
| server = os.getenv('ARKOUDA_SERVER_HOST', 'localhost') | ||
| full_stack_mode = True if os.getenv('ARKOUDA_FULL_STACK_TEST') == 'True' else False | ||
|
|
||
| @classmethod | ||
| def setUpClass(cls): | ||
| ''' | ||
| If in full stack mode, Configures and starts the arkouda_server process | ||
| If in full stack mode, Configures and starts the arkouda_server process, noop otherwise | ||
|
|
||
| :return: None | ||
| :raise: RuntimeError if there is an error in configuring or starting arkouda_server | ||
| ''' | ||
| if ArkoudaTest.full_stack_mode: | ||
| print('starting in full stack mode') | ||
| try: | ||
| nl = get_arkouda_numlocales() | ||
| (ArkoudaTest.server, ArkoudaTest.port, ArkoudaTest.ak_server) = start_arkouda_server(nl) | ||
| nl = int(get_arkouda_numlocales()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit but
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, will clean this up. |
||
| start_arkouda_server(numlocales=nl, host=ArkoudaTest.server, port=ArkoudaTest.port) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI this breaks our nightly XC and CS testing. The original motivation for start_arkouda_server is to launch the server, and once the server is up and running have it report the hostname and port back via a file, since on clusters/supercomputers you don't know the host ahead of time. e.g. if I'm running on cori, you'll only know the server hostname once you've made it through the slurm queue and been given your nodes. I think you could just stop passing the server to start_arkouda_server -- I'm not sure when you would need that in full stack mode.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ronawho oh wow, okay, I can take this out or set server to None. I put it in there because I am pretty sure that specifying the server was being added to Chapel and I wanted to enable configuration of the host (hostname or IP address) for situations where the are multiple NICs for the host.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ronawho okay, made it so the host can be none. Is passing in the ServerPort param okay: Please confirm and I'll wrap up these updates and submit a pull request.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think I'm missing something -- looks like that's the same code that's on master
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ronawho yes, it was merged into the master yesterday.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ooh, sorry -- I misread, I thought you were asking me if this new code snippet looked ok, but you were just asking if the code on master that passes the port is ok. Yeah, we don't do anything with the port, that change is good. |
||
| print('Started arkouda_server in full stack test mode') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're making changes, would you mind adding the number of locales to this print statement just so it's easy to see how many are being used?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ronawho sure thing! |
||
| except Exception as e: | ||
| raise RuntimeError('in configuring or starting the arkouda_server: {}, check ' + | ||
|
|
@@ -73,5 +72,7 @@ def tearDownClass(cls): | |
| :return: None | ||
| ''' | ||
| if ArkoudaTest.full_stack_mode: | ||
| print('Stopping arkouda_server in full stack test mode') | ||
| stop_arkouda_server() | ||
| try: | ||
| stop_arkouda_server() | ||
| except Exception as e: | ||
| raise RuntimeError(e) | ||
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.
In our nightly XC/CS testing we
export ARKOUDA_NUMLOCALES=16-- does the env var take priority, or does the value in the .ini file? (Based on a quick test it seems like the value in the ini file)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.
Deferring to you for pytest expertise, but maybe we can prefix these with
D:to not override command line settings?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.
@ronawho You are correct and it sounds like it's dorking up your nightly test so I will take that out of pytest.ini.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'm fine leaving it in if the
.inistyle is what python programmers will be used to. I think it'd just need to beD:ARKOUDA_NUMLOCALES=2so that command line settings won't be overwrittenThere 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.
@ronawho gotcha, okay