Skip to content

Commit 1de321a

Browse files
committed
Add tests website
1 parent 5f9172a commit 1de321a

File tree

6 files changed

+105
-1
lines changed

6 files changed

+105
-1
lines changed

.github/workflows/publish-docs.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,24 @@ jobs:
3636
with:
3737
path: "demos/readme/index.qmd"
3838

39+
- name: Render test suite
40+
uses: quarto-dev/quarto-actions/render@v2
41+
with:
42+
path: "tests"
43+
3944
# Collect the output into the staging/ directory
4045
- name: Copy documentation portal & demos into the staging directory
4146
run: |
4247
mkdir -p staging/{demos,tests} && \
4348
cp -rp docs/_site/* staging/ && \
49+
cp -rp tests/_site/* staging/tests/ && \
4450
cp -rp demos/readme/ staging/demos/readme
4551
4652
# Remove symlinks
4753
- name: Delete symlinks
4854
run: |
49-
rm -rf staging/demos/*/_extensions
55+
rm -rf staging/demos/*/_extensions && \
56+
rm -rf staging/tests/_extensions
5057
5158
# Publish the docs directory onto gh-pages
5259
- name: Deploy 🚀

docs/_quarto.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ website:
1818
- section: "Getting Started"
1919
- section: "Support"
2020
contents:
21+
- href: qpyodide-faq.qmd
22+
text: "Frequently Asked Questions"
2123
- href: https://github.com/coatless-quarto/pyodide/issues/new
2224
text: Submit an issue
2325
- section: "Demos"

tests/_extensions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_extensions

tests/_quarto.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "Test Suite for quarto-pyodide"
6+
search: true
7+
reader-mode: true
8+
sidebar:
9+
style: "floating"
10+
contents:
11+
- href: index.qmd
12+
text: Home
13+
- href: ../../
14+
text: Main Website
15+
- section: "Tests"
16+
contents:
17+
- auto: "*test*.qmd"
18+
19+
20+
page-footer:
21+
left: "Test suite for quarto-webr."
22+
right:
23+
- icon: github
24+
href: https://github.com/coatless-quarto/pyodide
25+
26+
# Set the language that should be used for Quarto websites
27+
# https://github.com/quarto-dev/quarto-cli/tree/main/src/resources/language
28+
# lang: en
29+
30+
# Attach pyodide to every page
31+
filters:
32+
- pyodide

tests/index.qmd

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "quarto-pyodide Test Website"
3+
subtitle: "Extension Test Suite"
4+
---
5+
6+
# Welcome
7+
8+
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.
9+
10+
```{webr-r}
11+
print("Welcome to behind the scenes of quarto-pyodide!")
12+
```

tests/qpyodide-internal-cell.qmd

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "Test: Cell Context Options"
3+
format: html
4+
engine: knitr
5+
filters:
6+
- pyodide
7+
---
8+
9+
Test page for verifying cell context options set explicitly with `context`.
10+
11+
## Interactive
12+
13+
### Static
14+
```{pyodide-python}
15+
#| context: interactive
16+
1 + 1
17+
```
18+
19+
### Autorun
20+
21+
```{pyodide-python}
22+
#| context: interactive
23+
#| autorun: true
24+
1 + 1
25+
```
26+
27+
## Setup
28+
29+
Hidden cell that sets `x` and `y` vector values.
30+
31+
```{pyodide-python}
32+
#| context: setup
33+
x = c(1, 5, 3, -2)
34+
y = c(-5, 8, 9, 4)
35+
```
36+
37+
## Output
38+
39+
Hidden cell that retrieves previously set `x` and `y` vector values and displays the data.
40+
41+
```{pyodide-python}
42+
#| context: output
43+
cat("x: ")
44+
print(x)
45+
46+
cat("y: ")
47+
print(y)
48+
49+
plot(x, y)
50+
```

0 commit comments

Comments
 (0)