Skip to content
Novus Examples
yml624 B

Azure Pipelines, Intentionally Invalid

An intentionally invalid Azure Pipelines file: valid YAML that mixes top-level steps with a stages block, depends on an undeclared stage, and gives `pool` a bare string. For testing that a validator rejects it and reports all three faults.

Preview — first 26 linesyml
# INTENTIONALLY INVALID. Well-formed YAML, invalid Azure Pipelines in three documented ways:
#   1. `stages` and top-level `steps` are mutually exclusive; both are present
#   2. the Deploy stage depends on a stage name that is never declared
#   3. `pool` is given a bare string where a mapping or a named pool is required
trigger:
  - main

pool: ubuntu-latest

steps:
  - script: echo "top-level steps"

stages:
  - stage: Build
    jobs:
      - job: Compile
        steps:
          - script: make build

  - stage: Deploy
    dependsOn: Package
    jobs:
      - job: Ship
        steps:
          - script: echo ship

Specifications

System
Azure Pipelines
Variant
intentionally invalid
Yaml Well Formed
true
Schema Violations
3

Testing contract

Expected to fail
Scenario
Validate an Azure Pipelines file that mixes mutually exclusive top-level shapes
Expected result
Validation fails with at least 3 errors, including the steps/stages conflict and the dependsOn reference to the undeclared Package stage

What is a .yml file?

YML is an alternate file extension for YAML, a human-readable data-serialization format based on indentation, key-value mappings, and lists. The content and parsing rules are identical to .yaml; only the extension differs. It is widely used for CI and application configuration files.

How to use this file

Use an example YML file to test that config loaders treat .yml and .yaml identically, and to exercise indentation, comment, and multi-document parsing.

How to use this file for testing

“Azure Pipelines, Intentionally Invalid” is a deterministic Novus Examples fixture for Error handling, Config parsing, Schema validation. Deliberately corrupt and invalid files, clearly labelled, for testing how your tool fails.

Documented properties for this file: YML · 624 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.

Code examples

import yaml  # pip install pyyaml

with open("azure-pipelines-invalid.yml") as f:
    data = yaml.safe_load(f)
print(data)

Generated by generation/pipelines.py. Free for any use, no attribution required — license.