Skip to content

Commit

Permalink
added smoke test (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Jun 15, 2023
1 parent 76745eb commit fccebda
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ jobs:
- name: Run unit tests with pytest
run: |
python -m pytest tests
- name: Run notebooks
run: |
rail render-nb
9 changes: 6 additions & 3 deletions src/rail/hub/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def cli() -> None:
@options.inputs()
def render_nb(outdir, clear_output, dry_run, inputs, **kwargs):
"""Render jupyter notebooks"""
scripts.render_nb(outdir, clear_output, dry_run, inputs)
return scripts.render_nb(outdir, clear_output, dry_run, inputs)


@cli.command()
Expand All @@ -30,7 +30,8 @@ def render_nb(outdir, clear_output, dry_run, inputs, **kwargs):
def clone_source(outdir, git_mode, dry_run, package_file, **kwargs):
"""Install packages from source"""
scripts.clone_source(outdir, git_mode, dry_run, package_file)

return 0


@cli.command()
@options.outdir(default='..')
Expand All @@ -40,7 +41,8 @@ def clone_source(outdir, git_mode, dry_run, package_file, **kwargs):
def install(outdir, dry_run, from_source, package_file, **kwargs):
"""pip install rail packages one by one, to be fault tolerant"""
scripts.install(outdir, from_source, dry_run, package_file)

return 0


@cli.command()
@options.outdir(default='..')
Expand All @@ -53,3 +55,4 @@ def install(outdir, dry_run, from_source, package_file, **kwargs):
def info(**kwargs):
"""pip install rail packages one by one, to be fault tolerant"""
scripts.info(**kwargs)
return 0
5 changes: 5 additions & 0 deletions src/rail/hub/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ def render_nb(outdir, clear_output, dry_run, inputs, **kwargs):
render = os.system(comline)
status[nb_file] = render

ret_val = 0
for key, val in status.items():
print(f"{key} {val}")
if val != 0:
ret_val = val

return ret_val


def clone_source(outdir, git_mode, dry_run, package_file):

Expand Down

0 comments on commit fccebda

Please sign in to comment.