Skip to content

feat: add discover-path key to integration-suites to decouple suite identity from test directory #46

@javierdelapuente

Description

@javierdelapuente

Problem

The suite key in integration-suites currently serves two purposes:

  1. The unique suite identifier (used as the spread suite name and as the build/<key>/run/task.yaml path)
  2. The filesystem path used for test auto-discovery

This makes it impossible to run the same set of tests twice with different environments (e.g. juju 3.6 and juju 4) within a single integration-suites block, since YAML keys must be unique.

Proposed solution

Add an optional discover-path: key to integration-suites entries. When set, opcli uses it for test discovery instead of the suite key. The suite key remains just a unique identifier (and a valid filesystem path for build/<key>/run/task.yaml generation).

Example

integration-suites:
  tests/integration/:
    cwd: ./
    summary: integration tests on juju 3.6
    backends:
    - integration-test

  tests/integration/juju4/:
    discover-path: tests/integration/
    discover-pattern: "*_jubilant.py"
    cwd: ./
    summary: jubilant tests on juju 4
    backends:
    - integration-test
    environment:
      CONCIERGE: concierge-juju4.yaml

Here tests/integration/juju4/ does not need to exist on disk — it's just a unique suite name. opcli discovers tests from discover-path instead.

Context

Encountered while adding juju 4 variants for jubilant integration tests in traefik-k8s-operator. The current workaround is to use manual MODULE/ variants, which partially works but loses the benefit of auto-discovery and requires keeping variant names in sync with test files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions