def test_invalid_config(self): file_names = glob.glob('./config_files/invalid/*.yml') for fn in file_names: experiment_config = get_yml_content(fn) try: validate_all_content(experiment_config, fn) print_error('config file:', fn,'Schema error should be raised for invalid config file!') assert False except SchemaError as e: print_green('config file:', fn, 'Expected error catched:', e)
def create_mock_experiment(): nnictl_experiment_config = Experiments() nnictl_experiment_config.add_experiment('xOpEwA5w', 8080, 123456, 'local', 'example_sklearn-classification') # mock process cmds = ['sleep', '3600000'] process = Popen(cmds, stdout=PIPE, stderr=STDOUT) nnictl_experiment_config.update_experiment('xOpEwA5w', 'pid', process.pid) nnictl_experiment_config.update_experiment('xOpEwA5w', 'port', 8080) nnictl_experiment_config.update_experiment('xOpEwA5w', 'webuiUrl', ['http://localhost:8080']) print_green("expriment start success, experiment id: xOpEwA5w")
def create_mock_experiment(): nnictl_experiment_config = Experiments() nnictl_experiment_config.add_experiment('xOpEwA5w', '8080', 123456, 'local', 'example_sklearn-classification') nni_config = Config('xOpEwA5w') # mock process cmds = ['sleep', '3600000'] process = Popen(cmds, stdout=PIPE, stderr=STDOUT) nni_config.set_config('restServerPid', process.pid) nni_config.set_config('experimentId', 'xOpEwA5w') nni_config.set_config('restServerPort', 8080) nni_config.set_config('webuiUrl', ['http://localhost:8080']) yml_path = Path(__file__).parents[1] / 'config_files/valid/test.yml' experiment_config = get_yml_content(str(yml_path)) nni_config.set_config('experimentConfig', experiment_config) print_green("expriment start success, experiment id: xOpEwA5w")
def test_valid_config(self): file_names = glob.glob('./config_files/valid/*.yml') for fn in file_names: experiment_config = get_yml_content(fn) validate_all_content(experiment_config, fn) print_green('config file:', fn, 'validation success!')