Skip to content

Commit

Permalink
Add tests website
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Feb 12, 2024
1 parent 5f9172a commit 1de321a
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,24 @@ jobs:
with:
path: "demos/readme/index.qmd"

- name: Render test suite
uses: quarto-dev/quarto-actions/render@v2
with:
path: "tests"

# Collect the output into the staging/ directory
- name: Copy documentation portal & demos into the staging directory
run: |
mkdir -p staging/{demos,tests} && \
cp -rp docs/_site/* staging/ && \
cp -rp tests/_site/* staging/tests/ && \
cp -rp demos/readme/ staging/demos/readme
# Remove symlinks
- name: Delete symlinks
run: |
rm -rf staging/demos/*/_extensions
rm -rf staging/demos/*/_extensions && \
rm -rf staging/tests/_extensions
# Publish the docs directory onto gh-pages
- name: Deploy 🚀
Expand Down
2 changes: 2 additions & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ website:
- section: "Getting Started"
- section: "Support"
contents:
- href: qpyodide-faq.qmd
text: "Frequently Asked Questions"
- href: https://github.com/coatless-quarto/pyodide/issues/new
text: Submit an issue
- section: "Demos"
Expand Down
1 change: 1 addition & 0 deletions tests/_extensions
32 changes: 32 additions & 0 deletions tests/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
project:
type: website

website:
title: "Test Suite for quarto-pyodide"
search: true
reader-mode: true
sidebar:
style: "floating"
contents:
- href: index.qmd
text: Home
- href: ../../
text: Main Website
- section: "Tests"
contents:
- auto: "*test*.qmd"


page-footer:
left: "Test suite for quarto-webr."
right:
- icon: github
href: https://github.com/coatless-quarto/pyodide

# Set the language that should be used for Quarto websites
# https://github.com/quarto-dev/quarto-cli/tree/main/src/resources/language
# lang: en

# Attach pyodide to every page
filters:
- pyodide
12 changes: 12 additions & 0 deletions tests/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "quarto-pyodide Test Website"
subtitle: "Extension Test Suite"
---

# Welcome

Welcome to the test suite website for the [`quarto-pyodide`](https://github.com/coatless-quarto/pyodide). This website is meant to examine how different features of the extension are working or not working across different browsers.

```{webr-r}
print("Welcome to behind the scenes of quarto-pyodide!")
```
50 changes: 50 additions & 0 deletions tests/qpyodide-internal-cell.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "Test: Cell Context Options"
format: html
engine: knitr
filters:
- pyodide
---

Test page for verifying cell context options set explicitly with `context`.

## Interactive

### Static
```{pyodide-python}
#| context: interactive
1 + 1
```

### Autorun

```{pyodide-python}
#| context: interactive
#| autorun: true
1 + 1
```

## Setup

Hidden cell that sets `x` and `y` vector values.

```{pyodide-python}
#| context: setup
x = c(1, 5, 3, -2)
y = c(-5, 8, 9, 4)
```

## Output

Hidden cell that retrieves previously set `x` and `y` vector values and displays the data.

```{pyodide-python}
#| context: output
cat("x: ")
print(x)
cat("y: ")
print(y)
plot(x, y)
```

0 comments on commit 1de321a

Please sign in to comment.