Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/detect-affected-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
# after it only so both feed the final filter step back to back.
- name: Diff package versions
id: diff
uses: ./.github/actions/diff-package-versions
uses: $/.github/actions/diff-package-versions
with:
before: ${{ inputs.before }}
after: ${{ inputs.after }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/detect-version-bumps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
steps:
- name: Diff package versions
id: diff
uses: ./.github/actions/diff-package-versions
uses: $/.github/actions/diff-package-versions
with:
before: ${{ inputs.before }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-python-package-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
check:
uses: ./.github/workflows/reusable-check-python-package-versions.yaml
uses: $/.github/workflows/reusable-check-python-package-versions.yaml
permissions:
id-token: write # Required for AWS CodeArtifact OIDC authentication
contents: read
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Detect affected packages
id: detect
if: github.event_name != 'pull_request'
uses: ./.github/actions/detect-affected-packages
uses: $/.github/actions/detect-affected-packages
with:
before: ${{ github.event.before }}

Expand Down Expand Up @@ -109,13 +109,13 @@ jobs:

- name: Get CodeArtifact credentials
id: ca
uses: ./.github/actions/code-artifact
uses: $/.github/actions/code-artifact

# Delegates to the same composite action the PR smoke test exercises, so
# the version formula only has one implementation to keep correct.
- name: Compute version
id: compute
uses: ./.github/actions/compute-version
uses: $/.github/actions/compute-version
with:
package: ${{ matrix.package }}
context: main
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Detect version bumps
id: detect
uses: ./.github/actions/detect-version-bumps
uses: $/.github/actions/detect-version-bumps
with:
before: ${{ github.event.before }}

Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
uv run overture-schema json-schema --tag overture > overture-schema.json

- name: Create release
uses: ./.github/actions/create-package-release
uses: $/.github/actions/create-package-release
with:
package: ${{ matrix.package }}
version: ${{ matrix.version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

- name: Diff package versions
id: diff
uses: ./.github/actions/diff-package-versions
uses: $/.github/actions/diff-package-versions
with:
before: ${{ inputs.before_commit }}
after: ${{ inputs.after_commit }}
Expand All @@ -106,7 +106,7 @@ jobs:
- name: Get CodeArtifact index URL
id: get-code-artifact-index-url
if: steps.save-changes.outputs.num_changed_packages > 0
uses: ./.github/actions/code-artifact
uses: $/.github/actions/code-artifact
with:
aws_account_id: ${{ inputs.aws_account_id }}
aws_region: ${{ inputs.aws_region }}
Expand Down Expand Up @@ -140,4 +140,4 @@ jobs:
else
echo "Package ${package} version ${after} is new, as expected. Continuing."
fi
done
done
10 changes: 5 additions & 5 deletions packages/overture-schema-cli/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from collections.abc import Generator
from io import StringIO
from pathlib import Path
from typing import Any
from unittest.mock import patch

Expand All @@ -11,11 +12,10 @@


@pytest.fixture
def cli_runner() -> Generator[CliRunner, None, None]:
"""Provide a CliRunner within an isolated filesystem."""
runner = CliRunner()
with runner.isolated_filesystem():
yield runner
def cli_runner(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> CliRunner:
"""Provide a CliRunner running in an empty working directory."""
monkeypatch.chdir(tmp_path)
return CliRunner()


@pytest.fixture
Expand Down
23 changes: 10 additions & 13 deletions packages/overture-schema-cli/tests/test_cli_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest
import yaml
from click.exceptions import UsageError
from click.testing import CliRunner
from conftest import build_feature
from pydantic import BaseModel, ValidationError

Expand Down Expand Up @@ -38,9 +39,7 @@ def test_load_input_file_not_found(self) -> None:

assert "is not a file" in str(exc_info.value)

def test_load_input_path_is_directory(
self, cli_runner: pytest.FixtureRequest
) -> None:
def test_load_input_path_is_directory(self, cli_runner: CliRunner) -> None:
"""Test that load_input raises UsageError when path is a directory.

Note: cli_runner provides isolated filesystem for test file creation.
Expand All @@ -54,7 +53,7 @@ def test_load_input_path_is_directory(

assert "is not a file" in str(exc_info.value)

def test_load_input_invalid_yaml(self, cli_runner: pytest.FixtureRequest) -> None:
def test_load_input_invalid_yaml(self, cli_runner: CliRunner) -> None:
"""Test that load_input raises YAMLError for invalid YAML.

Note: cli_runner provides isolated filesystem for test file creation.
Expand All @@ -66,7 +65,7 @@ def test_load_input_invalid_yaml(self, cli_runner: pytest.FixtureRequest) -> Non
with pytest.raises(yaml.YAMLError):
load_input(Path(invalid_yaml))

def test_load_input_handles_json(self, cli_runner: pytest.FixtureRequest) -> None:
def test_load_input_handles_json(self, cli_runner: CliRunner) -> None:
"""Test that load_input can parse JSON files.

Note: cli_runner provides isolated filesystem for test file creation.
Expand All @@ -82,7 +81,7 @@ def test_load_input_handles_json(self, cli_runner: pytest.FixtureRequest) -> Non
assert data["id"] == "test"
assert source_name == json_file

def test_load_input_handles_list(self, cli_runner: pytest.FixtureRequest) -> None:
def test_load_input_handles_list(self, cli_runner: CliRunner) -> None:
"""Test that load_input can parse YAML lists.

Note: cli_runner provides isolated filesystem for test file creation.
Expand All @@ -105,7 +104,7 @@ def test_load_input_handles_list(self, cli_runner: pytest.FixtureRequest) -> Non
)
def test_load_input_warns_unexpected_extension(
self,
cli_runner: pytest.FixtureRequest,
cli_runner: CliRunner,
capsys: pytest.CaptureFixture,
extension: str,
) -> None:
Expand All @@ -131,7 +130,7 @@ def test_load_input_warns_unexpected_extension(
)
def test_load_input_no_warning_expected_extension(
self,
cli_runner: pytest.FixtureRequest,
cli_runner: CliRunner,
capsys: pytest.CaptureFixture,
extension: str,
) -> None:
Expand All @@ -149,7 +148,7 @@ def test_load_input_no_warning_expected_extension(
captured = capsys.readouterr()
assert captured.err == ""

def test_load_input_binary_file(self, cli_runner: pytest.FixtureRequest) -> None:
def test_load_input_binary_file(self, cli_runner: CliRunner) -> None:
"""Test graceful failure on binary files.

Note: cli_runner provides isolated filesystem for test file creation.
Expand All @@ -161,9 +160,7 @@ def test_load_input_binary_file(self, cli_runner: pytest.FixtureRequest) -> None
with pytest.raises((yaml.YAMLError, UnicodeDecodeError)):
load_input(Path(binary_file))

def test_load_input_unicode_filenames(
self, cli_runner: pytest.FixtureRequest
) -> None:
def test_load_input_unicode_filenames(self, cli_runner: CliRunner) -> None:
"""Test files with unicode names.

Note: cli_runner provides isolated filesystem for test file creation.
Expand All @@ -180,7 +177,7 @@ def test_load_input_unicode_filenames(
assert source_name == unicode_filename

def test_load_input_jsonl_from_stdin(
self, cli_runner: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch
self, cli_runner: CliRunner, monkeypatch: pytest.MonkeyPatch
) -> None:
"""Test that load_input handles newline-delimited JSON (JSONL) from stdin.

Expand Down
Loading
Loading