Skip to content

Commit

Permalink
fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
miraculixx committed Aug 17, 2019
1 parent 334653e commit 34f5bd0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
3 changes: 1 addition & 2 deletions docs/source/nb/omegaml-tutorial.ipynb
Expand Up @@ -357,8 +357,7 @@
"params = {\n",
" 'n_clusters': range(1,8),\n",
" }\n",
"meta = om.runtime.model('iris-model').gridsearch('iris[^y]', 'iris[y]', parameters=params).get()\n",
"meta.name"
"om.runtime.model('iris-model').gridsearch('iris[^y]', 'iris[y]', parameters=params).get()"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions omegaml/tests/features/environment.py
Expand Up @@ -43,6 +43,9 @@ def before_all(context):
context.om = om.setup()
context.nbfiles = os.environ.get('BEHAVE_NBFILES', './docs/source/nb')

def before_scenario(context, scenario):
# FIXME we do this because context.feature is set dynamically in EE testing
context.feature.jynb_url = context.jynb_url

def after_step(context, step):
context.screenshotfn = os.path.join(context.screenshot_path, step.name + '.png')
Expand Down
4 changes: 2 additions & 2 deletions omegaml/tests/features/steps/notebook.py
Expand Up @@ -8,7 +8,7 @@
@when(u'we open jupyter')
def open_jupyter(ctx):
br = ctx.browser
br.visit(ctx.jynb_url)
br.visit(ctx.feature.jynb_url)
nb = Notebook(br)
login_required = br.is_text_present('Password', wait_time=2)
login_required |= br.is_text_present('token', wait_time=2)
Expand Down Expand Up @@ -61,7 +61,7 @@ def list_datasets(ctx):
@then(u'we can add a notebook in the folder')
def add_notebook_in_folder(ctx):
br = ctx.browser
br.visit(ctx.jynb_url)
br.visit(ctx.feature.jynb_url)
nb = Notebook(br)
nb.jupyter_home
nb.open_folder('Untitled Folder')
Expand Down
8 changes: 5 additions & 3 deletions omegaml/tests/features/steps/tftutorial.py
Expand Up @@ -19,17 +19,18 @@ def uploadtutorial(ctx, nbname):
nbcells = nbread(nbfname, as_version=4)
om.jobs.put(nbcells, nbname)
# now run the notebook
br.visit(ctx.jynb_url)
br.visit(ctx.feature.jynb_url)
assert br.is_text_present(nbname)


@when('we run the notebook {nbname}')
def runnotebook(ctx, nbname):
br = ctx.browser
om = ctx.feature.om
br.visit(ctx.jynb_url)
br.visit(ctx.feature.jynb_url)
nb = Notebook(br)
nb.open_notebook(nbname)
# FIXME sometimes it takes long for the nb to appear. why?
nb.open_notebook(nbname, retry=10)
nb.run_all_cells(wait=True)
nb.save_notebook()
assert not br.is_text_present('Error')
Expand All @@ -38,6 +39,7 @@ def runnotebook(ctx, nbname):
assert not br.is_text_present('MissingSchema')
assert not br.is_text_present('error')


@then('model {model_name} exists')
def checkmodel(ctx, model_name):
br = ctx.browser
Expand Down
8 changes: 7 additions & 1 deletion omegaml/tests/features/util.py
Expand Up @@ -84,9 +84,15 @@ def create_notebook(self, folder=None):
self.last_notebook
return self

def open_notebook(self, name):
def open_notebook(self, name, retry=5):
self.jupyter_home
br = self.browser
retry = 5
# FIXME sometimes it takes long for the nb to appear why?
while retry:
br.reload()
found = br.is_text_present(name, wait_time=60)
retry = 0 if found else retry
item = br.find_link_by_partial_text(name)
item.click()
sleep(2)
Expand Down

0 comments on commit 34f5bd0

Please sign in to comment.