Automation
Performance runs
A performance run sends a collection's requests from many virtual users at once and measures how the API holds up. Choose Performance run… on a collection or folder, or type the collection's name after Performance run of in the command palette. Then set:
- Virtual users, from 1 to 200
- Duration, from 1 second to 1 hour
- Ramp-up, the time over which the users start, no longer than the run
- Thresholds, such as a p95 latency or an error rate, which decide whether the run passes
While it runs, a chart shows latency each second and the p50, p90, p95 and p99. When
it ends, export an HTML or JSON report with secret values masked. Performance runs
happen in the desktop app, or with porticol-cli perf.
Flows
A flow chains requests with conditions and loops, and passes values from one step to the next. Choose New flow in the command palette, and Show flows to list them.
A flow is made of steps:
- a request, which can keep a value from the response's body, a header or the status for later steps
- a condition, with steps for when it holds and when it doesn't
- a loop over a list, with a variable for each item
Steps read the flow's variables, kept values, the environment and globals as
{{name}}. Run a flow to follow each step in its trace. A flow has at most 1,000
steps, 16 levels deep, and a run at most 10,000 steps. porticol-cli flow runs a flow
file in CI.
Monitors
A monitor runs a collection on a schedule from the server, and alerts when it fails. Owners and admins set them up in the account portal, under Administration > Monitors: the collection, the environment, the schedule, thresholds and where alerts go.
- Alerts go to email, Slack, Microsoft Teams or a signed webhook, and only to destinations an administrator has allowed.
- A monitor alerts once after two failing runs in a row, and once more when it passes again.
- Each monitor's runs and its uptime are kept.
A monitor's requests are sent from the server, as are those of a run started there
through the REST API or porticol-cli --remote. Each goes through a guard that checks
every address the host resolves to, never follows a redirect and caps the size of the
answer. It refuses loopback, private, link-local and cloud metadata addresses, unless
a team server's operator allows private ones. Scripts in a monitored collection run in
a sandbox with time and memory limits.
Continuous integration
porticol-cli runs collections, performance runs and flows from files, Postman exports
or a workspace on the server read with an API token, with the same results as the
app's runner. It writes JUnit, JSON and HTML reports and exits with a code a pipeline
can act on: 0 passed, 1 a test or threshold failed, 2 a request could not be made, 3 the
job's own configuration is wrong, and 5 or 6 for the contract and lint gates. The
command line reference lists every option, and the REST API reference the
operations a token can reach.
A collection file in the repository runs with no account. A run of a server's collections
needs a token: in a pipeline, make one on the account portal's API
tokens page (the account menu, then API tokens), choose the workspace and the
scopes the job needs, and copy the value as it is shown: it is shown once. Save it as a
secret in the pipeline, named PORTICOL_TOKEN here, and pass it to the run:
PORTICOL_TOKEN="$PORTICOL_TOKEN" porticol-cli run --server https://cloud.porticol.app --collection Checkout
A token for CI against a server's collections needs the Team plan.
This job runs a collection, keeps the JUnit report and fails the build when a test does.
The version is pinned once, so a new release does not change what the pipeline runs, and
the archive is checked against SHA256SUMS before it is unpacked. The architecture is
the runner's own, so ubuntu-24.04-arm takes the arm64 build:
env:
PORTICOL_CLI_VERSION: 0.1.0
jobs:
api-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install porticol-cli
run: |
case "${{ runner.arch }}" in
X64) platform=linux-x64 ;;
ARM64) platform=linux-arm64 ;;
*) echo "no porticol-cli for ${{ runner.arch }}" >&2; exit 1 ;;
esac
base="https://updates.porticol.app/$PORTICOL_CLI_VERSION"
curl -fsSLO "$base/porticol-cli-$PORTICOL_CLI_VERSION-$platform.tar.gz"
curl -fsSL "$base/SHA256SUMS" -o SHA256SUMS
grep " porticol-cli-$PORTICOL_CLI_VERSION-$platform.tar.gz$" SHA256SUMS | sha256sum -c -
tar -xzf "porticol-cli-$PORTICOL_CLI_VERSION-$platform.tar.gz" porticol-cli
- run: ./porticol-cli run checkout.json -e staging.json --secret apiKey -r junit:report.xml
env:
apiKey: ${{ secrets.API_KEY }}
PORTICOL_TOKEN: ${{ secrets.PORTICOL_TOKEN }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: api-tests
path: report.xml
The binary is static, so it runs on any Linux of that architecture, Alpine included.
Windows runners take the .zip from the same folder.
Secrets
An environment exported from Porticol names its secrets and leaves their values out, so
the file can be committed. The run takes each value from the pipeline's own secret store
with --secret NAME, which reads the environment variable of that name, or with
--secret NAME=value; --env-var NAME does the same as the first, and --env-file .env
reads a file of NAME=value lines for a machine that has one. A secret a pipeline does
not supply stops the run before anything is sent, naming it, rather than sending an
empty credential. Values given this way are masked in every report.
Nothing has to be written to disk: a secret is never a file the pipeline edits.
Docker
A container image holds the same static binary, so a job that already runs in a container needs no download step:
- run: |
docker run --rm -e apiKey -e PORTICOL_TOKEN -v "$PWD:/work" -w /work \
ghcr.io/pavanmanishd/porticol-cli:$PORTICOL_CLI_VERSION \
run checkout.json -e staging.json --secret apiKey -r junit:report.xml
env:
apiKey: ${{ secrets.API_KEY }}
PORTICOL_TOKEN: ${{ secrets.PORTICOL_TOKEN }}
The image is built from release/cli.Dockerfile for each release.