Skip to content

Commit

Permalink
Merge pull request #103 from anutosh491/TODO
Browse files Browse the repository at this point in the history
Update CI as per micromamba version and address TODO
  • Loading branch information
SylvainCorlay authored Oct 8, 2024
2 parents 748d174 + 7c4a015 commit cfdaf75
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment-dev.yml

Expand Down Expand Up @@ -63,24 +63,29 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ windows-latest]
include:
- name : windows
os: windows-latest
micromamba_shell_init: cmd.exe

steps:
- uses: actions/checkout@v2

- name: install mamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment-dev.yml
init-shell: >-
${{ matrix.micromamba_shell_init }}
environment-name: xeus-r

- name: micromamba shell hook
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
micromamba shell hook -s cmd.exe --root-prefix C:\Users\runneradmin\micromamba-root
- name: cmake configure
shell: cmd
shell: cmd /C call {0}
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-r
mkdir -p build
Expand All @@ -89,10 +94,11 @@ jobs:
-G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DXEUS_BUILD_TESTS=ON ^
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%\Library"
- name: build
shell: cmd
- name: build & install
shell: cmd /C call {0}
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-r
cd build
Expand All @@ -102,8 +108,8 @@ jobs:
xcopy %CONDA_PREFIX%\Library\share\jupyter\kernels\xr %CONDA_PREFIX%\share\jupyter\kernels\xr /F /Y
- name: test
shell: cmd
shell: cmd /C call {0}
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-r
cd test
pytest . -vv
pytest -sv test_xr_kernel.py
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ dependencies:
- nbval
- pytest-rerunfailures
- r-ggplot2
- r-htmltools
17 changes: 7 additions & 10 deletions test/test_xr_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ class KernelTests(jupyter_kernel_test.KernelTests):
incomplete_code_samples = ["fun(", "1 + "]
invalid_code_samples = ["fun())", "a |> b", "a |> b(_)", "a |> b(c(_))"]

# TODO: Fix failing test_htmlwidget test case
"""
def test_htmlwidget(self):
self.flush_channels()
reply, output_msgs = self.execute_helper(code="library('htmltools'); h1('hello')")
data = output_msgs[0]['content']['data']
self.assertEqual(len(data), 2, data.keys())
self.assertIn("<html>", data["text/html"][0])
self.assertIn("<h1>hello</h1>", data["text/html"][0])
"""
def test_htmlwidget(self):
self.flush_channels()
reply, output_msgs = self.execute_helper(code="library('htmltools'); h1('hello')")
data = output_msgs[0]['content']['data']
self.assertEqual(len(data), 2, data.keys())
self.assertIn("<html>", data["text/html"][0])
self.assertIn("<h1>hello</h1>", data["text/html"][0])

#########################################################################################
#########################################################################################
Expand Down

0 comments on commit cfdaf75

Please sign in to comment.