Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

update ci #232

Merged
merged 4 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ steps:
- script: python3 -m pip install --upgrade pip setuptools
displayName: 'Install python tools'
- script: |
make easy-install
export PATH=$HOME/.nni/bin:$PATH
./install.sh
displayName: 'Install dependencies'
- script: |
cd test/naive
PATH=$HOME/.local/nni/node/bin:$PATH python3 run.py
source ~/.bashrc
python3 run.py
displayName: 'Run tests'
25 changes: 13 additions & 12 deletions test/naive/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ def remove_files(self, file_list):
with contextlib.suppress(FileNotFoundError):
os.remove(file_path)

def run(self):
os.environ['PATH'] = os.environ['PATH'] + ':' + os.environ['PWD']
sdk_path = os.path.abspath('../../src/sdk/pynni')
cmd_path = os.path.abspath('../../tools')
pypath = os.environ.get('PYTHONPATH')
if pypath:
pypath = ':'.join([pypath, sdk_path, cmd_path])
else:
pypath = ':'.join([sdk_path, cmd_path])
os.environ['PYTHONPATH'] = pypath
def run(self, installed = True):
if not installed:
os.environ['PATH'] = os.environ['PATH'] + ':' + os.environ['PWD']
sdk_path = os.path.abspath('../../src/sdk/pynni')
cmd_path = os.path.abspath('../../tools')
pypath = os.environ.get('PYTHONPATH')
if pypath:
pypath = ':'.join([pypath, sdk_path, cmd_path])
else:
pypath = ':'.join([sdk_path, cmd_path])
os.environ['PYTHONPATH'] = pypath

to_remove = ['tuner_search_space.json', 'tuner_result.txt', 'assessor_result.txt']
self.remove_files(to_remove)
Expand Down Expand Up @@ -105,10 +106,10 @@ def run(self):
assert assessor_result == expected, 'Bad assessor result'

if __name__ == '__main__':

installed = (sys.argv[-1] != '--preinstall')
ic = Integration_test()
try:
ic.run()
ic.run(installed)
# TODO: check the output of rest server
print(GREEN + 'PASS' + CLEAR)
except Exception as error:
Expand Down