Black Friday tra 20 giorni: i Suoi clienti potranno pagare? -25 % il 1° anno e configurazione offerta, fino al 30 novembreVedi l’offerta →
Integrazione
Smoke post-deploy: run-scenario fa fallire il job se il run non è ok. Alias run-and-wait.
Ottenere la mia chiave APIContratto OpenAPI
Documento completo, senza autenticazione, da passare al Suo generatore di client.
Action ufficiale pathlyhq/pathly-action@v1, pubblicata sul GitHub Marketplace (« Setup Pathly »). Operazioni: ping (verifica la chiave), assert-scenario (fallisce se lastStatus ≠ ok, senza nuovo run), ensure-scenario (crea / aggiorna un Ping o una Chain tramite httpChain) e run-scenario (avvia un’esecuzione e fa fallire il job se lo stato non è ok). run-and-wait è un alias di run-scenario. Metta PATHLY_API_TOKEN nei secret del repository.
Caso d’uso: dopo il job di test, assert-scenario fa fallire il workflow se l’ultimo percorso non è ok, senza avviare un nuovo run. Dopo un deploy, run-scenario riproduce il percorso e fa diventare rosso il workflow se fallisce. Ambiti minimi: runs:read per assert; runs:trigger + runs:read per run-scenario; scenarios:write per ensure-scenario.
assert-scenario dopo i test
# .github/workflows/pathly.yml
name: Pathly CI
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm test
pathly:
needs: test
runs-on: ubuntu-latest
steps:
- name: Assert last journey
uses: pathlyhq/pathly-action@v1
with:
api_token: ${{ secrets.PATHLY_API_TOKEN }}
operation: assert-scenario
scenario_id: ${{ vars.PATHLY_CHECKOUT_SCENARIO_ID }}run-scenario dopo il deploy
- name: Pathly run
uses: pathlyhq/pathly-action@v1
with:
api_token: ${{ secrets.PATHLY_API_TOKEN }}
operation: run-scenario
scenario_id: ${{ vars.PATHLY_CHECKOUT_SCENARIO_ID }}run-scenario dopo il deploy
- name: Pathly run
uses: pathlyhq/pathly-action@v1
with:
api_token: ${{ secrets.PATHLY_API_TOKEN }}
operation: run-scenario
scenario_id: ${{ vars.PATHLY_CHECKOUT_SCENARIO_ID }}assert-scenario (rapido, nessun nuovo run)
- name: Pathly assert
uses: pathlyhq/pathly-action@v1
with:
api_token: ${{ secrets.PATHLY_API_TOKEN }}
operation: assert-scenario
scenario_id: ${{ vars.PATHLY_CHECKOUT_SCENARIO_ID }}ping post-deploy
- name: Pathly ping
uses: pathlyhq/pathly-action@v1
with:
operation: ping
api_token: ${{ secrets.PATHLY_API_TOKEN }}ensure-scenario
- name: Ensure checkout
uses: pathlyhq/pathly-action@v1
with:
api_token: ${{ secrets.PATHLY_API_TOKEN }}
operation: ensure-scenario
scenario_json: |
{
"name": "Checkout",
"url": "https://www.example.com/cart",
"intervalSec": 300,
"severity": "major"
}