Skip to content

Commit

Permalink
Update build for JupyterLab 3.6 (#5)
Browse files Browse the repository at this point in the history
* add yarn.lock after deduplication, update github action

* missed an overrides replacement

* move cd command up
  • Loading branch information
mlhenderson authored Jul 28, 2023
1 parent a56956c commit cbe8fe1
Show file tree
Hide file tree
Showing 2 changed files with 4,284 additions and 31 deletions.
88 changes: 57 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ on: [push, workflow_dispatch]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
steps:
# Get the current repo files and install node
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v3
with:
node-version: '16.x'
Expand All @@ -14,47 +20,67 @@ jobs:
ls ${{ github.workspace }}
# Install jupyterlab
- run: pip install jupyterlab
- name: Install JupyterLab
run: |
python -m pip install "jupyterlab>=3.5.0,<4"
jupyter lab --version
jupyter --paths
# Install the extension and show where it was installed
- run: pip install .
- run: jupyter labextension list
- name: Install the extension
run: |
python -m pip install .
jupyter labextension list
# Create the overrides.json file and copy the data from example_overrides, then set fetch source
- name: Set overrides
run: |
mkdir -p /home/runner/.local/etc/jupyter/labconfig
cp example_overrides.json /home/runner/.local/etc/jupyter/labconfig/default_setting_overrides.json
echo '{"nersc-refresh-announcements:plugin": { "url": "http://localhost:3000" } }' > /home/runner/.local/etc/jupyter/labconfig/default_setting_overrides.json
# Download and install gecko web driver
- run: wget https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux64.tar.gz
- run: sudo tar -xzf geckodriver-v0.32.2-linux64.tar.gz -C /usr/bin
- run: sudo chmod a+x /usr/bin/geckodriver
- name: Get web driver
run: |
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux64.tar.gz
sudo tar -xzf geckodriver-v0.32.2-linux64.tar.gz -C /usr/bin
sudo chmod a+x /usr/bin/geckodriver
# Install selenium and pytest
- run: pip install selenium
- run: pip install pytest
- name: Install Selenium
run: python -m pip install selenium
- name: Install pytest
run: python -m pip install pytest

# Install necessary server packages and start the server
- run: cd tests/test-server
- run: npm install express
- run: npm install cors
- run: npm install nodemon
- run: npm install
- run: (node ./tests/test-server/server.js &)

- run: cd ../..

# Create the overrides.json file and set to fetch from localhost:3000
- run: mkdir /home/runner/.local/share/jupyter/lab/settings
- run:
>
echo '{"nersc-refresh-announcements:plugin": { "url": "http://localhost:3000" } }' > /home/runner/.local/share/jupyter/lab/settings/overrides.json
- name: Setup mock server for tests
run: |
cd tests/test-server
npm install express
npm install cors
npm install nodemon
npm install
cd ../..
(node ./tests/test-server/server.js &)
# Start jupyterlab and run the nonempty test
- run: jupyter labextension list
- run: jupyter lab --port=8888 --NotebookApp.token='' &
- run: pytest tests/test_nonempty_announcement.py
- name: Start jupyterlab
run: |
jupyter labextension list
jupyter lab --port=8888 --NotebookApp.token='' &
- name: Run nonempty test
run: |
pytest tests/test_nonempty_announcement.py
# Kill and restart the server
- run: killall -9 node
- run: cd tests/test-server
- run: (node ./tests/test-server/server.js --empty-announcement &)
- name: Restart nodejs server
run: |
killall -9 node
cd tests/test-server
(node ./tests/test-server/server.js --empty-announcement &)
cd ../..
# Run empty announcements test
- run: cd ../..
- run: pytest tests/test_empty_announcement.py
- name: Run empty announcement test
run: |
pytest tests/test_empty_announcement.py
Loading

0 comments on commit cbe8fe1

Please sign in to comment.