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

Commit

Permalink
Update integration test (#624)
Browse files Browse the repository at this point in the history
* Update integration test

* updates
  • Loading branch information
chicm-ms authored Jan 17, 2019
1 parent 7ba8c6b commit 0dcdf0c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
6 changes: 5 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ jobs:
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts local
displayName: 'Examples on local machine tests'
displayName: 'Examples and advanced features tests on local machine'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
displayName: 'Trial job metrics test'
- job: 'macOS_10_13'
pool:
Expand Down
8 changes: 1 addition & 7 deletions test/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,13 @@
import argparse
import glob
import subprocess
import sys
import time
import traceback

from utils import setup_experiment, get_experiment_status, get_yml_content, dump_yml_content, \
parse_max_duration_time, get_succeeded_trial_num, print_stderr
from utils import GREEN, RED, CLEAR, STATUS_URL, TRIAL_JOBS_URL

GREEN = '\33[32m'
RED = '\33[31m'
CLEAR = '\33[0m'

STATUS_URL = 'http://localhost:8080/api/v1/nni/check-status'
TRIAL_JOBS_URL = 'http://localhost:8080/api/v1/nni/trial-jobs'

def gen_new_config(config_file, training_service='local'):
'''
Expand Down
9 changes: 1 addition & 8 deletions test/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@
import json

from utils import get_experiment_status, get_yml_content, parse_max_duration_time, get_succeeded_trial_num

GREEN = '\33[32m'
RED = '\33[31m'
CLEAR = '\33[0m'

STATUS_URL = 'http://localhost:8080/api/v1/nni/check-status'
TRIAL_JOBS_URL = 'http://localhost:8080/api/v1/nni/trial-jobs'
METRICS_URL = 'http://localhost:8080/api/v1/nni/metric-data'
from utils import GREEN, RED, CLEAR, STATUS_URL, TRIAL_JOBS_URL, METRICS_URL

def run_test():
'''run metrics test'''
Expand Down
7 changes: 1 addition & 6 deletions test/naive_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
import traceback

from utils import is_experiment_done, fetch_nni_log_path, read_last_line, remove_files, setup_experiment

GREEN = '\33[32m'
RED = '\33[31m'
CLEAR = '\33[0m'

EXPERIMENT_URL = 'http://localhost:8080/api/v1/nni/experiment'
from utils import GREEN, RED, CLEAR, EXPERIMENT_URL

def run():
'''run naive integration test'''
Expand Down
10 changes: 10 additions & 0 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@

EXPERIMENT_DONE_SIGNAL = '"Experiment done"'

GREEN = '\33[32m'
RED = '\33[31m'
CLEAR = '\33[0m'

REST_ENDPOINT = 'http://localhost:8080/api/v1/nni'
EXPERIMENT_URL = REST_ENDPOINT + '/experiment'
STATUS_URL = REST_ENDPOINT + '/check-status'
TRIAL_JOBS_URL = REST_ENDPOINT + '/trial-jobs'
METRICS_URL = REST_ENDPOINT + '/metric-data'

def read_last_line(file_name):
'''read last line of a file and return None if file not found'''
try:
Expand Down

0 comments on commit 0dcdf0c

Please sign in to comment.