|
| 1 | +# Functional unit tests for the model-apps plugin, across ubuntu × windows × macos |
| 2 | +# and Node 20 × 22. |
| 3 | +# |
| 4 | +# Why a matrix: these scripts shell out to `pac`/`az`, build filesystem paths, and |
| 5 | +# parse CLI output, so path-separator and shell differences are a real regression |
| 6 | +# class that a single-OS run would miss. Both Node versions are covered because the |
| 7 | +# plugin is developed on Node 22 while the repo's other test workflow pins Node 20 — |
| 8 | +# a version-only failure should be attributable, not a mystery. |
| 9 | +# |
| 10 | +# Deliberately mirrors `power-pages-script-tests.yml` rather than extending it: the |
| 11 | +# two plugins have independent path filters, so a change to one must not spend CI |
| 12 | +# time on the other. |
| 13 | +name: model-apps-script-tests |
| 14 | + |
| 15 | +on: |
| 16 | + pull_request: |
| 17 | + branches: |
| 18 | + - main |
| 19 | + paths: |
| 20 | + - "plugins/model-apps/**" |
| 21 | + # The eval harness lives at the repo root but is owned by this plugin, so |
| 22 | + # an eval-only change must still trigger the eval job below. |
| 23 | + - "evals/model-apps/**" |
| 24 | + - ".github/workflows/model-apps-script-tests.yml" |
| 25 | + |
| 26 | +jobs: |
| 27 | + test-model-apps-scripts: |
| 28 | + name: test-model-apps-scripts (${{ matrix.os }}, node ${{ matrix.node }}) |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + # Defense-in-depth: opt this CI job out of telemetry transmission so a test |
| 31 | + # that forgets to isolate emission can never POST to a real collector. The |
| 32 | + # plugin's committed ikey.json currently ships `disabled: true`, but that is |
| 33 | + # a value that can change; the guard must not depend on it. Suppresses |
| 34 | + # TRANSMISSION only — the local diagnostic mirror is still written, so this |
| 35 | + # cannot change what the tests actually assert. |
| 36 | + env: |
| 37 | + POWER_PLATFORM_SKILLS_TELEMETRY_MODEL_APPS_OPTOUT: "1" |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + os: |
| 42 | + - ubuntu-latest |
| 43 | + - windows-latest |
| 44 | + - macos-latest |
| 45 | + node: |
| 46 | + - 20 |
| 47 | + - 22 |
| 48 | + steps: |
| 49 | + - name: checkout |
| 50 | + uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: setup-node |
| 53 | + uses: actions/setup-node@v4 |
| 54 | + with: |
| 55 | + node-version: ${{ matrix.node }} |
| 56 | + |
| 57 | + # run-tests.js is the plugin's own regression gate: it runs every |
| 58 | + # scripts/tests/*.test.js and exits non-zero on any failure. Invoking it |
| 59 | + # (rather than a bare `node --test`) keeps CI and the documented local |
| 60 | + # command identical, so a green PR means the same thing a green local run |
| 61 | + # does. The vendored SDK's own Jest suite is intentionally NOT run here — |
| 62 | + # it needs a Node-20-ABI `canvas` native module and the SDK source tree, |
| 63 | + # neither of which exists in this repo; the real-bundle contract tests in |
| 64 | + # scripts/tests/ cover the shipped bundle instead. |
| 65 | + - name: run-model-apps-script-tests |
| 66 | + shell: bash |
| 67 | + working-directory: plugins/model-apps |
| 68 | + run: node scripts/run-tests.js |
| 69 | + |
| 70 | + test-model-apps-evals: |
| 71 | + name: test-model-apps-evals |
| 72 | + runs-on: ubuntu-latest |
| 73 | + env: |
| 74 | + POWER_PLATFORM_SKILLS_TELEMETRY_MODEL_APPS_OPTOUT: "1" |
| 75 | + steps: |
| 76 | + - name: checkout |
| 77 | + uses: actions/checkout@v4 |
| 78 | + |
| 79 | + - name: setup-node |
| 80 | + uses: actions/setup-node@v4 |
| 81 | + with: |
| 82 | + node-version: 20 |
| 83 | + |
| 84 | + # The eval harness lives at the repo root (evals/model-apps/**) but is |
| 85 | + # owned by this plugin, so it is gated by the same path filter. These are |
| 86 | + # the offline scoring/fixture tests only — the Layer 1/2 runners need a |
| 87 | + # live Dataverse org and are run manually. |
| 88 | + - name: run-model-apps-eval-tests |
| 89 | + shell: bash |
| 90 | + run: node --test evals/model-apps/app-builder/tests/*.test.js evals/model-apps/genpage/tests/*.test.js |
0 commit comments