Skip to main content

CI Test

Evan Kohilas

A framework for static analysis testing of CI configurations.

Installation

Install using pipx install ci-test-toolkit to add ci-test to your PATH.

The tool can be run either via ci-test once installed or python -m ci_test from within the src folder.

Example

ci-test gitlab rule-snapshot <path_to_json> will create a snapshot of your ci configuration, by listing all rulesets and the jobs that will run for each of them.

This snapshot can then be used to generate diffs of the linking between jobs and their rules.

Input Generation

Currently the tool is setup to take input of the following form:

[
    {
        "name": "job-name",
        "rules": [
            {
                "if": "$CI_PIPELINE_SOURCE == 'push'"
            },
            {
                "if": "$CI_PIPELINE_SOURCE == 'merge_request_event'",
                "changes": [
                    "**/*.py"
                ]
            },
        ]
    }
]

This is easiest made using gitlab-ci-local

With node installed, run npx gitlab-ci-local --list-json > gitlab-ci-local.json in a project directory with a .gitlab-ci.yml file.

Then, run ci-test gitlab rule-snapshot gitlab-ci-local.json to create a collated snapshot.

TODO

  • Remove the dependency on gitlab-ci-local
  • Support GitHub configurations
  • Add more testing commands
  • Add better CLI
  • Add linting/formatting
  • Clean up for best practices

Contibuting

Please see CONTRIBUTING.md for a head start.

Pull requests welcome!

Release files for ci-test 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ci-test 0.0.6
File Size Uploaded
ci_test-0.0.6.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ci-test 0.0.6
File Interpreter ABI Platform
ci_test-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / ci_test-0.0.6.tar.gz

Download URL ci_test-0.0.6.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a7bd33e2af4c9946c28ada346e1ff46ab93127ee786478e15959f04c00fd15ef
BLAKE2b-256 checksum
How to use checksums
f5ea4ef715f40ab8cca785240efb92ec7ccd921ff68931cc50bca3f4d528cd2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2025.

Transparency log

Release files / ci_test-0.0.6-py3-none-any.whl

Download URL ci_test-0.0.6-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a707a7d1b8e0991d211cb21f623b43f5421a0253ecfc7cb9b90ad5f38753368a
BLAKE2b-256 checksum
How to use checksums
db352aa3a6510a65bebaa4148595c34477d6052ddd53fb9a9e791e58b7967a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page