Skip to content

Commit c7a8dd8

Browse files
committed
ci: tests and style fixes
1 parent c3e07d0 commit c7a8dd8

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,20 @@ jobs:
7474
node-version: '22'
7575
cache: 'npm'
7676

77+
- name: Setup Julia
78+
uses: julia-actions/setup-julia@v2
79+
with:
80+
version: '1.11'
81+
82+
- name: Install Pluto.jl
83+
run: julia -e 'using Pkg; Pkg.add("Pluto")'
84+
7785
- name: Install dependencies
7886
run: npm ci
7987

8088
- name: Run unit tests
8189
run: npm run test:unit
82-
# //TODO: figureout how to run these in CI and what actually to test there
90+
# //TODO: figureout how to run these in CI and what actually to test there
8391
# - name: Run vscode tests
8492
# run: npm test:unit
8593

TESTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ The PlutoManager tests use **comprehensive integration testing** with a real Plu
77
### Test Approach
88

99
**Single Workflow Test** - One comprehensive test that:
10+
1011
- Opens a notebook
1112
- Performs all operations sequentially
1213
- Verifies each step works correctly
1314
- Tests the complete lifecycle end-to-end
1415

1516
This approach provides:
17+
1618
- ✅ Realistic usage patterns
1719
- ✅ Fast execution (no repeated setup/teardown)
1820
- ✅ Clear verification of functionality
@@ -88,6 +90,7 @@ This approach provides:
8890
- No notebooks open
8991

9092
**Plus 2 constructor tests**:
93+
9194
- Default port initialization
9295
- Custom server URL
9396

@@ -117,18 +120,21 @@ npm run test:unit -- --runInBand plutoManager.test.ts
117120
### Mocking Strategy
118121

119122
**What we mock:**
123+
120124
- `vscode` module - Only what's needed by PlutoServerTaskManager:
121125
- `workspace.getConfiguration` (for Julia settings)
122126
- Task-related types (TaskExecution, ShellExecution, etc.)
123127
- Notebook types (for serializer tests)
124128

125129
**What we DON'T mock:**
130+
126131
- ❌ Pluto server - use real Julia Pluto server
127132
- ❌ File system - use real file operations
128133
-@plutojl/rainbow - use real library
129134
- ❌ PlutoServerTaskManager - use real implementation
130135

131136
This integration testing approach provides:
137+
132138
- ✅ More realistic test scenarios
133139
- ✅ Better confidence in functionality
134140
- ✅ Easier test maintenance
@@ -137,12 +143,21 @@ This integration testing approach provides:
137143

138144
### Prerequisites
139145

140-
- Julia must be installed and available in PATH
146+
**Local Development:**
147+
148+
- Julia 1.11+ must be installed and available in PATH
141149
- Pluto.jl package must be installed: `julia -e 'using Pkg; Pkg.add("Pluto")'`
142150

151+
**CI/CD:**
152+
153+
- GitHub Actions CI automatically installs Julia 1.11 and Pluto.jl
154+
- The test job uses `julia-actions/setup-julia@v2` to set up Julia
155+
- Pluto.jl is installed before running tests
156+
143157
### Test Structure
144158

145159
**Sequential Workflow Test**:
160+
146161
```typescript
147162
it("should perform complete notebook lifecycle workflow", async () => {
148163
// Step 1: Test initial state
@@ -163,6 +178,7 @@ it("should perform complete notebook lifecycle workflow", async () => {
163178
```
164179

165180
**Benefits of Sequential Testing**:
181+
166182
- ✅ Tests realistic usage patterns
167183
- ✅ Verifies operations work together
168184
- ✅ Faster than isolated tests (no repeated setup)

0 commit comments

Comments
 (0)