Skip to content

Commit

Permalink
Set up CI with Azure Pipelines (#1)
Browse files Browse the repository at this point in the history
* gtri#2: azure pipelines, more formatting, etc

* Set up CI with Azure Pipelines

* gtri#2: try node 10 on windows

* gtri#2: install kernels, return rc from run

* gtri#2: some more fixes for windows, chrome

* gtri#2: utf-8 all the things

* gtri#2: try updating conda on windows

* gtri#2: apparently have a local PR, so can just test before actual PR

* gtri#2: force re-install of pyzmq on windows

* gtri#2: only do zmq stuff in windows

* gtri#2: try defaults first

* gtri#2: try pip for zmq on windows

* gtri#2: more chromedriver shenanigans, fix conda invocation

* gtri#2: try more conda and completion stuff

* gtri#2: more conda stuff

* gtri#2: force jupyter_server

* gtri#2: give up on linting on windows

* gtri#2: normalize some browser stuff

* gtri#2: linting

* gtri#2: keep tightening up scripts, etc

* gtri#2: fix more scripts

* gtri#2: in, not ==

* gtri#2: back to defaults for windows

* gtri#2: bring back the zmq hack

* gtri#2: add win envs

* move bootstrap

* gtri#2: more windows

* gtri#2: win test env extends test

* gtri#2: skip more win

* typo

* longer timeout

* gtri#2: on empty test, test everything, but fail on any

* add fast fail -x to full test

* gtri#2: combine tests and combine

* gtri#2: normalize more things for windows

* oh, windows npm

* more verbose output

* gtri#2: clean up more build stuff

* just use jlpm

* more win stuff

* try moving packages

* no src in packages

* peering

* errant output

* linting

* get more specific with tsc call

* more work on shutdown

* further simplify js stuff for win

* more error weirdness on windows

* try more tsconfig tricks

* move tsconfig back up

* lint first

* more un-nesting

* lint first

* invoking scripts

* wheeling

* build once

* install once

* naming

* move chromedriver import

* don't run unit tests in build

* combine needs nbformat

* publish naming

* naming, some conditions

* try cobertura

* lint actual src

* gah, build, not b

* enter the matrix

* update test outputs for py version

* doesn't like test

* maybe in variables?

* variables get uppercased?

* drop py altogether on names

* fix variable typo

* maybe just os name

* try conditions

* re-combine some steps

* always with the variables

* more parameters

* more parameters

* condition can't see params?

* always can be in if

* bigger ifs

* display name last?

* try different variables

* back to conditions

* move import of nbformat to appropriate linter

* remove python3 refs

* split up build

* fix artifact names

* try using wheels/sdist

* pytest whole module

* accept jinja2 as a dependency, for now... use vdom if possible, later, or offer plain text (ick)

* gah, missed jinja on non-win

* wow, bad at this

* add environment for testing in windows with python 3.7

* bump the npm tools

* try old lts

* add command for now

* more verbose

* move stuff back

* execution_count normalizing

* try win37 a couple times
  • Loading branch information
bollwyvl authored Feb 8, 2019
1 parent 865311e commit e06f9f4
Show file tree
Hide file tree
Showing 57 changed files with 3,724 additions and 803 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ envs/
lib/
node_modules/
Untitled*.ipynb
.coverage
.coverage*
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
> _Interactive Acceptance Test-Driven Development and Robot Process Automation,
> powered by [IPython](http://ipython.org) and [Robot Framework](https://robotframework.org)_

irobotframework is a Jupyter Kernel that provides provides Robot Framework:

- test **execution** with **rich output** from Robot notebooks
- ...and IPython with `%%robot`
- code **completion** and **inspection** in notebooks and consoles
Expand All @@ -13,31 +13,26 @@ irobotframework is a Jupyter Kernel that provides provides Robot Framework:

Learn more in the documentation:

| Interactive | HTML | Notebooks | GitHub |
|-|-|-|-|
| [Binder](https://mybinder.org/v2/gh/gtri/irobotframework/master?urlpath=lab%2Ftree%2Fdocs%2Findex.ipynb) | [readthedocs](https://irobotframework.readthedocs.org) | [nbviewer](https://github.com/gtri/irobotframework/docs/index.ipynb) | [GitHub](https://github.com/gtri/irobotframework/docs/index.ipynb)

| Interactive | HTML | Notebooks | GitHub |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [Binder](https://mybinder.org/v2/gh/gtri/irobotframework/master?urlpath=lab%2Ftree%2Fdocs%2Findex.ipynb) | [readthedocs](https://irobotframework.readthedocs.org) | [nbviewer](https://github.com/gtri/irobotframework/docs/index.ipynb) | [GitHub](https://github.com/gtri/irobotframework/docs/index.ipynb) |

## Features

| Feature | Screenshot |
|---------|------------|
| _Launch Robot Framework as a Notebook, Console or edit Robot files_ | [![][screenshot_launcher]][screenshot_launcher]
| _Get rich completion of Robot language features, Libraries, Keywords and Variables_ | [![][screenshot_complete]][screenshot_complete]
| _Inspect Libraries and Keywords... even ones you're writing_ | [![][screenshot_inspect]][screenshot_inspect]
| _Work with Robot in IPython as an extension_ | [![][screenshot_magic]][screenshot_magic]
| _Use Console and Rich display_ | [![][screenshot_console]][screenshot_console]



| Feature | Screenshot |
| ----------------------------------------------------------------------------------- | ----------------------------------------------- |
| _Launch Robot Framework as a Notebook, Console or edit Robot files_ | [![][screenshot_launcher]][screenshot_launcher] |
| _Get rich completion of Robot language features, Libraries, Keywords and Variables_ | [![][screenshot_complete]][screenshot_complete] |
| _Inspect Libraries and Keywords... even ones you're writing_ | [![][screenshot_inspect]][screenshot_inspect] |
| _Work with Robot in IPython as an extension_ | [![][screenshot_magic]][screenshot_magic] |
| _Use Console and Rich display_ | [![][screenshot_console]][screenshot_console] |

[screenshot_complete]: ./docs/_static/screenshots/screenshot_complete.png
[screenshot_console]: ./docs/_static/screenshots/screenshot_console.png
[screenshot_inspect]: ./docs/_static/screenshots/screenshot_inspect.png
[screenshot_launcher]: ./docs/_static/screenshots/screenshot_launcher.png
[screenshot_magic]: ./docs/_static/screenshots/screenshot_magic.png


## Install

```bash
Expand All @@ -62,17 +57,20 @@ anaconda-project run bootstrap
```

Now launch JupyterLab

```bash
anaconda-project run lab
```

Live develop by running the following in two prompts:

```bash
anaconda-project run jlpm watch
anaconda-project run lab --watch
```

> Note: Python changes require a kernel restart, TypeScript changes require a
browser reload
> browser reload
## Free Software

Expand Down
108 changes: 41 additions & 67 deletions anaconda-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,44 @@ commands:
unix: atom .
env_spec: test
bootstrap:
unix: |-
set -eux \
&& pip install -e . --ignore-installed --no-deps --no-cache-dir \
&& jupyter kernelspec install \
--name robotframework \
--sys-prefix \
src/irobotframework/resources \
&& jupyter kernelspec list \
&& jlpm bootstrap
unix: python -m scripts.bootstrap
windows: python -m scripts.bootstrap
env_spec: default
build:docs:
description: build the docs
unix: sphinx-build docs dist/docs
env_spec: docs
build:docs:watch:
description: build the docs
unix: sphinx-autobuild -b html docs dist/docs
env_spec: docs
build:pip:sdist:
description: build a pip sdist
unix: |-
set -eux \
&& python setup.py clean \
&& python setup.py sdist --dist-dir ${PROJECT_DIR}/dist/pip
env_spec: test
build:pip:wheel:
description: build a pip wheel
unix: |-
set -eux \
&& python setup.py clean \
&& python setup.py bdist_wheel --dist-dir ${PROJECT_DIR}/dist/pip
env_spec: test
build:npm:
description: build an npm package
unix: |-
set -eux \
&& mkdir -p dist/npm \
&& cd src/packages/jupyterlab-robotframework \
&& mv $(npm pack) ../../../dist/npm/
env_spec: test
jlpm:
description: run the yarn bundled with JupyterLab
unix: jlpm
build:
unix: python -m scripts.build
windows: python -m scripts.build
env_spec: default
watch:
description: watch the [d]ocs
unix: python -m scripts.watch
windows: python -m scripts.watch
env_spec: docs
lab:
description: run JupyterLab
unix: jupyter lab --no-browser --debug
windows: jupyter lab --no-browser --debug
env_spec: default
lab:build:
description: rebuild JupyterLab
unix: jupyter lab build --dev
lab:dist:
description: run JupyterLab in the built dist folder
unix: jupyter lab --no-browser --debug --app-dir dist/lab
windows: jupyter lab --no-browser --debug --app-dir dist\lab
env_spec: default
ipython:
description: run IRobotFramework in the terminal
windows: ipython --kernel-name robotframework
unix: ipython --kernel-name robotframework
env_spec: default
test:py:
unix: mkdir -p _testoutput && cd _testoutput && pytest
env_spec: test
test:robot:
unix: set -eux \
&& cd atest/acceptance \
&& python -m robot -d ../../_testoutput --xunit junit_robot.xml .
test:
description: |
run all the tests or specify [l]int, [u]nit, [a]cceptance, [c]ombine.
extra args passed to underlying scripts for unit, acceptance, and combine,
while lint accepts targets
unix: python -m scripts.test
windows: python -m scripts.test
env_spec: test
test:release:
unix: python -m scripts.release_check ${NEXT_RELEASE}
env_spec: test
test:lint:
unix: |-
set -eux \
&& python -m scripts.nblint \
&& python -m scripts.copyright \
&& python -m robot.tidy -r atest \
&& rflint \
--configure TooManyTestSteps:20 \
--configure TooFewKeywordSteps:0 \
--configure LineTooLong:200 \
atest/**/*.robot \
&& black --line-length 88 setup.py ./src/irobotframework/ scripts docs \
&& flake8 --max-line-length=88 \
&& jlpm lint
env_spec: test
release:pypi:
unix: |-
set -eux \
Expand Down Expand Up @@ -119,9 +76,15 @@ env_specs:
- ipykernel >=5.1
- ipython >=7.2
- jupyterlab >=0.35.4,<0.36
- jinja2
- nodejs >=8.12,<9
- pillow
- robotframework >=3.1
default-win:
inherit_from:
- default
packages:
- nodejs>=8,<9
test:
description: an even-heavier test environment, because browsers
inherit_from:
Expand All @@ -130,6 +93,7 @@ env_specs:
- black
- flake8
- geckodriver
- isort
- jupyter_kernel_test
- pylint
- pytest
Expand All @@ -138,6 +102,16 @@ env_specs:
- robotframework-lint
- robotframework-seleniumlibrary >=3.2.0
- twine
test-win:
inherit_from:
- default-win
- test
test-win37:
inherit_from:
- default-win
- test
packages:
- python>=3.7,<3.8
docs:
inherit_from:
- default
Expand Down
2 changes: 1 addition & 1 deletion atest/acceptance/00_Smoke.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Documentation Some quick tests to see if we broke the build somehow.
Suite Setup Set Screenshot Directory ${OUTPUT_DIR}/${BROWSER}/smoke
Suite Setup Set Screenshot Directory ${OUTPUT_DIR}${/}smoke
Resource ../resources/Lab.robot
Resource ../resources/Browser.robot

Expand Down
4 changes: 2 additions & 2 deletions atest/acceptance/01_Python.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** Settings ***
Documentation Try out the python magics
Suite Setup Set Screenshot Directory ${OUTPUT_DIR}/${BROWSER}/python
Default Tags kernel:python browser:${BROWSER}
Suite Setup Set Screenshot Directory ${OUTPUT_DIR}${/}python
Default Tags kernel:python browser:${BROWSER} py:${PY}
Resource ../resources/Lab.robot
Resource ../resources/Browser.robot
Resource ../resources/Notebook.robot
Expand Down
6 changes: 3 additions & 3 deletions atest/acceptance/02_Robot/00_Basic.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Documentation Try out the Robot kernel
Default Tags kernel:robot browser:${BROWSER}
Default Tags kernel:robot browser:${BROWSER} py:${PY}
Resource ../../resources/Lab.robot
Resource ../../resources/Browser.robot
Resource ../../resources/Notebook.robot
Expand All @@ -10,7 +10,7 @@ Library SeleniumLibrary
*** Test Cases ***
Robot Test Case Notebook
[Documentation] Can we make a simple Robot Test notebook?
Set Screenshot Directory ${OUTPUT_DIR}/${BROWSER}/robot/base
Set Screenshot Directory ${OUTPUT_DIR}${/}robot${/}base
Capture Page Screenshot 00_before.png
Launch a new Robot Framework Notebook
Capture Page Screenshot 01_new.png
Expand All @@ -21,7 +21,7 @@ Robot Test Case Notebook

Robot Task Notebook
[Documentation] Can we make a simple Robot Process Automation notebook?
Set Screenshot Directory ${OUTPUT_DIR}/${BROWSER}/robot/rpa
Set Screenshot Directory ${OUTPUT_DIR}${/}robot${/}rpa
Capture Page Screenshot 00_before.png
Launch a new Robot Framework Notebook
Capture Page Screenshot 01_new.png
Expand Down
7 changes: 4 additions & 3 deletions atest/acceptance/02_Robot/01_Settings.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Documentation Work with Robot Suite Settings
Default Tags kernel:robot browser:${BROWSER} table:settings
Default Tags kernel:robot browser:${BROWSER} py:${PY} table:settings
Resource ../../resources/Lab.robot
Resource ../../resources/Browser.robot
Resource ../../resources/Notebook.robot
Expand All @@ -10,7 +10,7 @@ Library SeleniumLibrary
*** Test Cases ***
Robot Notebook Remembers Settings
[Documentation] Will re-running Settings create an error in the logs?
Set Screenshot Directory ${OUTPUT_DIR}/${BROWSER}/robot/settings/cellid
Set Screenshot Directory ${OUTPUT_DIR}${/}robot${/}settings${/}cellid
Capture Page Screenshot 00_before.png
Launch a new Robot Framework Notebook
Capture Page Screenshot 01_new.png
Expand All @@ -23,7 +23,8 @@ Robot Notebook Remembers Settings

Robot Notebook completes Settings
[Documentation] Will tabbing complete various Suite Settings?
Set Screenshot Directory ${OUTPUT_DIR}/${BROWSER}/robot/settings/complete
[Tags] skip:chrome skip:windows
Set Screenshot Directory ${OUTPUT_DIR}${/}robot${/}settings${/}complete
Launch a new Robot Framework Notebook
Add a Cell *** Set
Go to End of Cell Source
Expand Down
1 change: 0 additions & 1 deletion atest/resources/Browser.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ Documentation Some variables for Browser-related things.
*** Variables ***
${BROWSER} headlessfirefox
# ${BROWSER} Firefox
2 changes: 1 addition & 1 deletion atest/resources/CodeMirror.robot
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ Completions Should Contain
[Documentation] Does the completer show the expected completions?
[Arguments] @{completions}
:FOR ${c} IN @{completions}
\ Page Should Contain Element ${COMPLETE_CSS}\[data-value="${c}"]
\ Wait Until Page Contains Element ${COMPLETE_CSS}\[data-value="${c}"]
11 changes: 8 additions & 3 deletions atest/resources/Lab.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ Resource Commands.robot
*** Variables ***
${TOKEN} hopelesslyinsecure
${LAB_CMD} jupyter-lab --no-browser --NotebookApp.token=${TOKEN} --port 18888 --debug --ip=0.0.0.0
${LAB_URL} http://localhost:18888/lab?token=${TOKEN}
${BASE_URL} http://localhost:18888
${LAB_URL} ${BASE_URL}/lab?token=${TOKEN}
${TREE_URL} ${BASE_URL}/tree?token=${TOKEN}

*** Keywords ***
Wait for Splash Screen
Expand All @@ -29,8 +31,8 @@ Launch a new

Start JupyterLab
[Documentation] Start a Jupyter Notebook Server with JupyterLab
${notebooks} = Set Variable ${OUTPUT_DIR}${/}${BROWSER}${/}_notebooks
${log} = Set Variable ${OUTPUT_DIR}${/}${BROWSER}${/}_lab.log
${notebooks} = Set Variable ${OUTPUT_DIR}${/}_notebooks
${log} = Set Variable ${OUTPUT_DIR}${/}_lab.log
${cmd} = Set Variable ${LAB_CMD} --notebook-dir=${notebooks}
Create Directory ${notebooks}
Start Process ${cmd} shell=true stderr=STDOUT stdout=${log}
Expand Down Expand Up @@ -65,6 +67,9 @@ Reset Application State and Close

Clean Up JupyterLab
[Documentation] Close all the browsers and stop all processes
Open JupyterLab with ${BROWSER}
Go to ${TREE_URL}
Click Element css:#shutdown
Close All Browsers
Terminate All Processes kill=True

Expand Down
2 changes: 1 addition & 1 deletion atest/resources/LabRobot.robot
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Capture ${criteria} Robot "${document}" Screenshot
[Documentation] Verify that documents are clickable and contain expected content
${xpath} = Set Variable //a[text() = '${document}']
${title} = Set Variable Untitled Test Suite ${document}
Wait Until Page Contains Element ${xpath}
Wait Until Page Contains Element ${xpath} timeout=20s
Click Element ${xpath}
Sleep 1s
Select Window NEW
Expand Down
40 changes: 40 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
jobs:
- template: ci/job.build.yml

- template: ci/job.test.unit.yml
parameters:
name: Linux
vmImage: ubuntu-16.04

- template: ci/job.test.unit.yml
parameters:
name: MacOSX
vmImage: macos-10.13

- template: ci/job.test.unit.yml
parameters:
name: Windows
vmImage: vs2017-win2016

- template: ci/job.test.acceptance.yml
parameters:
name: Linux
vmImage: ubuntu-16.04

- template: ci/job.test.acceptance.yml
parameters:
name: MacOSX
vmImage: macos-10.13

- template: ci/job.test.acceptance.yml
parameters:
name: Windows
vmImage: vs2017-win2016

- template: ci/job.combine.yml

trigger:
- master

pr:
- master
Loading

0 comments on commit e06f9f4

Please sign in to comment.