Skip to content

Commit e7dedcd

Browse files
authored
Introduce Test Scenarios for WASM (#182)
## Purpose <!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? --> Introduce various test scenarios for CLI Test Runner and VSCode Extension Test Explorer. See samples/wasm/tests/README.md for more details ## Does this introduce a breaking change? <!-- Mark one with an "x". --> ``` [ ] Yes [x] No ``` ## Pull Request Type <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [x] Documentation content changes [ ] Other... Please describe: ``` ## How to Test See samples/wasm/tests/README.md ``` git clone [repo-address] cd [repo-name] git checkout [branch-name] npm install ``` * Test the code <!-- Add steps to run the tests suite and/or manually test --> ``` ``` ## What to Check Verify that the following are valid For CLI see: https://github.com/Azure/vscode-tinykube/tree/main/cli#test-workflow Run the command against each scenario For VSCode Extension: - Open ~/explore-iot-operations/wasm as a VSCode workspace - Go to "Test Explorer" tab and run each test scenario ## Other Information For more info see: https://github.com/Azure/vscode-tinykube/tree/main
1 parent 5fdff68 commit e7dedcd

32 files changed

Lines changed: 175 additions & 0 deletions

samples/wasm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This workspace is structured for the Azure IoT Operations VS Code extension so t
99
- `graph-complex.yaml`, `graph-otel.yaml`, `graph-otel-transform.yaml`, `graph-simple.yaml` – additional graphs
1010
- `data/`, `data-and-images/`, `images/` – sample inputs; extension runs write output to `data-and-images/output`
1111
- `schema-registry-scenario/`, `statestore-scenario/` – scenario source code YAMLs for schema registry and state store usage
12+
- `tests/` – automated test cases for the CLI test runner and VS Code Test Explorer (auto-discovered when `wasm/` is opened as a workspace)
1213
- `Dockerfile`, `Makefile`, `.cargo/` – Rust builder assets co-located here (see **Rust builds**)
1314
- [`../wasm-python`](../wasm-python/README.md) – Python operator workspace; see its README for language-specific guidance
1415

samples/wasm/tests/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Test runner output directories
2+
**/output/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"payload": "{\"temperature\":{\"value\":653.8888888888889,\"count\":0,\"max\":0.0,\"min\":0.0,\"average\":0.0,\"last\":0.0,\"unit\":\"C\",\"overtemp\":false}}"
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"temperature": {
3+
"value": 1209,
4+
"unit": "F"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: "Temperature F to C conversion"
2+
graph: "../../graph-simple.yaml"
3+
input: "./input"
4+
expected: "./expected/expected.json"
5+
timeout: 90000
6+
select: ["payload"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"payload": "{\"temperature\":[{\"count\":1,\"max\":653.8888888888889,\"min\":653.8888888888889,\"average\":653.8888888888889,\"last\":653.8888888888889,\"unit\":\"C\",\"overtemp\":true}]}"
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"temperature": {
3+
"value": 1209,
4+
"unit": "F"
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: "Complex pipeline - temperature accumulation"
2+
graph: "../../graph-complex.yaml"
3+
input: "./input"
4+
expected: "./expected/expected.json"
5+
timeout: 120000
6+
select: ["payload"]
7+
ignores:
8+
- "payload.humidity"
9+
- "payload.object"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"payload": "{\"temperature\":[{\"count\":1,\"max\":1695.0,\"min\":1695.0,\"average\":1695.0,\"last\":1695.0,\"unit\":\"C\",\"overtemp\":true}],\"humidity\":[{\"count\":1,\"max\":85.0,\"min\":85.0,\"average\":85.0,\"last\":85.0}],\"object\":[{\"result\":\"American black bear, black bear, Ursus americanus, Euarctos americanus\"}]}"
3+
}
129 KB
Binary file not shown.

0 commit comments

Comments
 (0)