Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
24cb18d
Add CI workflow for cn1playground language smoke tests
liannacasper Apr 7, 2026
da4aed4
Fix playground workflow script invocation permissions
liannacasper Apr 7, 2026
3cd3e09
Fix registry generator classpath for JDK8 tools API
liannacasper Apr 7, 2026
b29fbae
Use Java 17 and portable checks in playground smoke CI
liannacasper Apr 7, 2026
73abb3b
Build dependent modules in playground smoke Maven step
liannacasper Apr 7, 2026
e91778b
Run playground smoke harness from common module classpath
liannacasper Apr 7, 2026
1f9482d
Run playground smoke tests under Xvfb in CI
liannacasper Apr 7, 2026
e1285ac
Install reactor artifacts before running playground harness
liannacasper Apr 7, 2026
792e546
Force smoke harness process exit after success
liannacasper Apr 7, 2026
a6903ea
Add playground syntax matrix harness to smoke test pipeline
liannacasper Apr 7, 2026
e08c2eb
Use Java text blocks in syntax matrix snippets
liannacasper Apr 7, 2026
d2b1cc7
Stabilize syntax matrix outcomes and always exit process
liannacasper Apr 7, 2026
6c21e10
Document playground smoke workflow and syntax rollout process
liannacasper Apr 7, 2026
c7cd472
Expand syntax matrix to table-driven parse/eval coverage
liannacasper Apr 7, 2026
aecea50
Mark try-with-resources matrix cases as current parse gaps
liannacasper Apr 8, 2026
a9281ef
Enable try-with-resources without catch/finally in parser
liannacasper Apr 8, 2026
8af87c8
Throw evaluation error for enhanced-for over null
liannacasper Apr 8, 2026
a72f2af
Use local AutoCloseable resources in TWR matrix cases
liannacasper Apr 8, 2026
c60e28b
Use StringReader resources in TWR matrix cases
liannacasper Apr 8, 2026
a9f1b88
Enable BeanShell class generation for inline class declarations
liannacasper Apr 8, 2026
350450e
Handle superclass invocation checked exceptions in Name
liannacasper Apr 8, 2026
126d6cf
Support inline AutoCloseable class snippets without ASM generator
liannacasper Apr 8, 2026
76c5eca
Restore BeanShell class generation for playground runtime
liannacasper Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/cn1playground-language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CN1 Playground Language Tests

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'scripts/cn1playground/**'
- '.github/workflows/cn1playground-language.yml'
push:
branches: [main, master]
paths:
- 'scripts/cn1playground/**'
- '.github/workflows/cn1playground-language.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
language-smoke:
name: Playground language smoke
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
cache: maven

- name: Ensure Xvfb is available
run: |
set -euo pipefail
if ! command -v xvfb-run >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y xvfb
fi

- name: Run playground language smoke tests
run: |
set -euo pipefail
cd scripts/cn1playground
xvfb-run -a bash tools/run-playground-smoke-tests.sh
32 changes: 30 additions & 2 deletions scripts/cn1playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,37 @@ mvn clean install

```bash
cd scripts/cn1playground
./scripts/run-tests.sh
bash tools/run-playground-smoke-tests.sh
```

This smoke command currently runs:

1. CN1 access registry generation (`tools/generate-cn1-access-registry.sh`).
2. Registry sanity checks (expected/forbidden class entries).
3. `PlaygroundSmokeHarness` end-to-end behavior checks.
4. `PlaygroundSyntaxMatrixHarness` syntax regression checks.

## Language Feature Rollout Process

Use this process when adding or fixing Java syntax support in Playground:

1. **Add/adjust matrix coverage first**
Update `common/src/test/java/com/codenameone/playground/PlaygroundSyntaxMatrixHarness.java` with a focused snippet for the target syntax.
- For currently unsupported syntax, add as `ExpectedOutcome.FAILURE`.
- When support lands, flip that case to `ExpectedOutcome.SUCCESS`.

2. **Implement parser/runtime change in small steps**
Prefer one syntax feature per PR (e.g. method references only) to keep regressions easy to isolate.

3. **Run smoke + syntax matrix locally**
Run `bash tools/run-playground-smoke-tests.sh` from `scripts/cn1playground`.

4. **Require CI green before merge**
The `CN1 Playground Language Tests` workflow runs the same smoke command under CI (`xvfb-run`) and should pass before merging syntax updates.

5. **Document behavior changes**
Update this README's known issues/limitations when syntax support changes so users know what is now supported.

## Known Issues

1. **Parse errors with complex expressions**: BeanShell's parser may fail on some Java syntax. Simplify complex expressions or break them into multiple statements.
Expand All @@ -360,4 +388,4 @@ cd scripts/cn1playground

## Contributing

See the main Codename One repository for contribution guidelines.
See the main Codename One repository for contribution guidelines.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public Object eval(CallStack callstack, Interpreter interpreter) throws EvalErro
statement = nodeCount > 1 ? jjtGetChild(1) : null;
}
final Object iteratee = expression.eval(callstack, interpreter);
if (iteratee == null || iteratee == Primitive.NULL) {
throw new EvalException("Cannot iterate over null value", this, callstack);
}
final CollectionManager cm = CollectionManager.getCollectionManager();
final Iterator<?> iterator = cm.getBshIterator(iteratee);
try {
Expand Down
Loading
Loading