Skip to content

Commit 3ee1f4d

Browse files
authored
Merge pull request #1 from bollwyvl/ci/azure-pipelines
Set up CI with Azure Pipelines
2 parents a2487c1 + 7087793 commit 3ee1f4d

File tree

25 files changed

+376
-163
lines changed

25 files changed

+376
-163
lines changed

.projectignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.ipynb

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# robotframework-jupyterlibrary
22
> A Robot Framework library for testing Jupyter end-user applications and extensions
33
4-
---
4+
[![binder-badge][]][binder] [![pipeline-badge]][pipeline]
55

6-
> _TODO: binder, tests, pip, conda_
6+
> _TODO: rtd, pip, conda_
77
88
# Installation
99

@@ -21,7 +21,7 @@ pip install -e . --no-deps --ignore-installed
2121
```
2222
- run the tests
2323
```
24-
python -m atest.run
24+
python -m scripts.atest
2525
```
2626

2727
# Using
@@ -30,3 +30,9 @@ python -m atest.run
3030

3131
Write `.robot` files that use `JupyterLibrary` keywords. See the
3232
[acceptance tests](./atest/acceptance) for examples.
33+
34+
35+
[binder-badge]: https://mybinder.org/badge_logo.svg
36+
[binder]: https://mybinder.org/v2/gh/bollwyvl/robotframework-jupyterlibrary/master?urlpath=lab/tree/README.md
37+
[pipeline-badge]: https://dev.azure.com/nickbollweg/nickbollweg/_apis/build/status/bollwyvl.robotframework-jupyterlibrary
38+
[pipeline]: https://dev.azure.com/nickbollweg/nickbollweg/_build/latest?definitionId=2

anaconda-project.yml

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ commands:
99
unix: jupyter lab --no-browser --debug
1010
env_spec: rfjl37
1111

12+
lab:win:
13+
windows: jupyter lab --no-browser --debug
14+
env_spec: win_rfjl37
15+
1216
list:
1317
unix: jupyter serverextension list && jupyter notebook list --json
1418
env_spec: rfjl37
@@ -17,17 +21,42 @@ commands:
1721
unix: pip install -e . --no-deps --ignore-installed --no-cache-dir -vvv
1822
env_spec: rfjl37
1923

24+
setup:win:
25+
windows: pip install -e . --no-deps --ignore-installed --no-cache-dir -vvv
26+
env_spec: win_rfjl37
27+
2028
lint:
21-
unix: |-
22-
isort -rc src \
23-
&& black src setup.py \
24-
&& python -m robot.tidy -r atest
29+
unix: python -m scripts.lint
2530
env_spec: rfjl37
2631

2732
atest:
28-
unix: rm -rf _artifacts/test_output && python -m atest.run
33+
unix: rm -rf _artifacts/test_output && python -m scripts.atest
34+
env_spec: rfjl37
35+
36+
atest:win:
37+
windows: rmdir /s /q _artifacts\test_output && python -m scripts.atest
38+
env_spec: win_rfjl37
39+
40+
clean:
41+
unix: rm -rf $(find src | grep __pycache__)
42+
env_spec: rfjl37
43+
44+
sdist:
45+
unix: python setup.py sdist --dist-dir=_artifacts/sdist
46+
env_spec: rfjl37
47+
48+
sdist:win:
49+
windows: python setup.py sdist --dist-dir=_artifacts/sdist
50+
env_spec: win_rfjl37
51+
52+
install:
53+
unix: pip install . --no-deps --ignore-installed --no-cache-dir -vvv
2954
env_spec: rfjl37
3055

56+
install:win:
57+
windows: >
58+
python -m pip install _artifacts\\sdist\\robotframework-jupyterlibrary-0.1.0.tar.gz --no-deps --ignore-installed -vv
59+
env_spec: win_rfjl37
3160

3261
env_specs:
3362
robotframework-jupyterlibrary:
@@ -37,26 +66,37 @@ env_specs:
3766
- geckodriver
3867
- isort
3968
- jupyterlab
40-
- nodejs >8,<9
69+
- nodejs
4170
- pillow
42-
- pytest
43-
- pytest-cov
4471
- python-chromedriver-binary
4572
- robotframework
4673
- robotframework-lint
4774
- robotframework-seleniumlibrary
48-
- sphinx
49-
- sphinx_rtd_theme
75+
- six
5076
- pip:
5177
- nteract_on_jupyter
5278
channels:
5379
- conda-forge
5480
- defaults
81+
5582
rfjl37:
5683
inherit_from:
5784
- robotframework-jupyterlibrary
5885
packages:
5986
- python >=3.7,<3.8
87+
- nodejs >=8.12,<9
88+
89+
win_rfjl37:
90+
inherit_from:
91+
- robotframework-jupyterlibrary
92+
packages:
93+
- python >=3.7,<3.8
94+
95+
rfjl36:
96+
inherit_from:
97+
- robotframework-jupyterlibrary
98+
packages:
99+
- python >=3.6,<3.7
60100

61101
rfjl2:
62102
inherit_from:

atest/acceptance/01_server/00_basic.robot

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
*** Settings ***
2-
Test Teardown Terminate All Processes
2+
Suite Teardown Terminate All Jupyter Servers
33
Library JupyterLibrary
44
Library Process
55
Library OperatingSystem
66

77
*** Test Cases ***
88
Start one server
9-
${nbserver} = Start New Jupyter Server
9+
${nbserver} = Start New Jupyter Server stdout=${OUTPUT_DIR}${/}one_server.log stderr=STDOUT
1010
${ready} = Wait for Jupyter Server to be Ready
1111
Should be equal as integers ${ready} 1 msg=One server should be ready
1212
${terminated} = Terminate All Jupyter Servers
@@ -15,25 +15,23 @@ Start one server
1515
Should Contain ${log} The Jupyter Notebook is running msg=Log should contain expected status message
1616

1717
Start three servers
18-
${nb1} = Start New Jupyter Server
19-
${nb2} = Start New Jupyter Server
18+
${nb1} = Start New Jupyter Server stdout=${OUTPUT_DIR}${/}one_of_three_server.log stderr=STDOUT
19+
${nb2} = Start New Jupyter Server stdout=${OUTPUT_DIR}${/}two_of_three_server.log stderr=STDOUT
2020
${ready} = Wait for Jupyter Server to be Ready ${nb2} ${nb1}
2121
Should be equal as integers ${ready} 2 msg=Three servers should be ready
22-
${nb3} = Start New Jupyter Server
22+
${nb3} = Start New Jupyter Server stdout=${OUTPUT_DIR}${/}three_of_three_server.log stderr=STDOUT
2323
${terminated} = Terminate All Jupyter Servers
2424
Should be equal as integers ${terminated} 3 msg=Three servers should have been terminated
2525
${log1} = Get Process Result ${nb1} stderr=${True}
2626
Should Contain ${log1} The Jupyter Notebook is running msg=Log should contain expected status message
2727
${log2} = Get Process Result ${nb2} stderr=${True}
2828
Should Contain ${log2} The Jupyter Notebook is running msg=Log should contain expected status message
29-
${log3} = Get Process Result ${nb3} stderr=${True}
30-
Should Not Contain ${log3} The Jupyter Notebook is running msg=Unawaited server log should not contain expected status message
3129
${terminated} = Terminate All Jupyter Servers
3230
Should be equal as integers ${terminated} 0 msg=No servers should have been terminated
3331

3432
Notebook Files
3533
[Setup] Create File ${OUTPUT_DIR}${/}foo.txt bar
36-
${nb1} = Start New Jupyter Server
34+
${nb1} = Start New Jupyter Server stdout=${OUTPUT_DIR}${/}files.log stderr=STDOUT
3735
Copy Files to Jupyter Directory ${OUTPUT_DIR}${/}*.txt
3836
${nbdir} = Get Jupyter Directory ${nb1}
3937
${out} = Get File ${nbdir}${/}foo.txt
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*** Settings ***
2-
Suite Setup Wait for New Jupyter Server to be Ready
3-
Test Teardown Close All Browsers
2+
Suite Teardown Close All Browsers
3+
Test Teardown Reset JupyterLab and Close
44
Library JupyterLibrary
55
Library Process
66

@@ -11,10 +11,5 @@ Open JupyterLab
1111
Get Help
1212
Open JupyterLab
1313
Open With JupyterLab Menu Help About JupyterLab
14-
Capture Element Screenshot css:.jp-Dialog-content ${OUTPUT_DIR}${/}about.png
14+
Capture Element Screenshot css:.jp-Dialog-content about.png
1515
Click Element css:${JLAB CSS ACCEPT}
16-
17-
*** Keywords ***
18-
Clean Up Everything
19-
Close All Browsers
20-
Terminate All Processes

atest/acceptance/10_lab/10_notebook.robot

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*** Settings ***
2-
Suite Setup Wait for New Jupyter Server to be Ready
2+
Suite Teardown Close All Browsers
33
Test Teardown Reset JupyterLab and Close
44
Default Tags notebook
55
Library JupyterLibrary
@@ -19,9 +19,4 @@ IPython Notebook Outputs
1919
: FOR ${i} IN RANGE ${10}
2020
\ Add and Run Cell print("${i} hello world " * ${i ** 2})
2121
Wait Until Kernel Is Idle
22-
Screenshot Each Output of Active Document ${OUTPUT_DIR}${/}ipython_outputs/
23-
24-
*** Keywords ***
25-
Clean Up Everything
26-
Close All Browsers
27-
Terminate All Processes
22+
Screenshot Each Output of Active Document ipython_outputs${/}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*** Settings ***
2+
Suite Setup Wait for New Jupyter Server to be Ready
3+
Suite Teardown Terminate All Jupyter Servers
4+
Library JupyterLibrary

atest/acceptance/__init__.robot

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
*** Settings ***
2-
Suite Teardown Terminate All Processes
2+
Suite Setup Set Screenshot Directory ${OUTPUT_DIR}${/}screenshots
3+
Suite Teardown Clean Up Everything
4+
Library JupyterLibrary
35
Library Process
6+
7+
*** Keywords ***
8+
Clean Up Everything
9+
Close All Browsers
10+
Terminate All Jupyter Servers
11+
Terminate All Processes

atest/run.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
jobs:
2+
- template: ci/job.yml
3+
parameters:
4+
name: Linux
5+
vmImage: ubuntu-16.04
6+
7+
- template: ci/job.yml
8+
parameters:
9+
name: MacOSX
10+
vmImage: macos-10.13
11+
12+
- template: ci/job.yml
13+
parameters:
14+
name: Windows
15+
vmImage: vs2017-win2016
16+
17+
variables:
18+
MINICONDA_VERSION: 4.5.4
19+
CONDA_VERSION: 4.5.11
20+
21+
trigger: [master]
22+
23+
pr: [master]

0 commit comments

Comments
 (0)