Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark one test from hadolint and golangci_lint backends as platform-specific behaviour, test on macOS #21620

Merged
merged 4 commits into from
Nov 8, 2024
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,10 @@ jobs:
with:
distribution: adopt
java-version: '11'
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.19.5
- name: Download native binaries
uses: actions/download-artifact@v4
with:
Expand Down
9 changes: 8 additions & 1 deletion src/python/pants/backend/docker/lint/hadolint/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_sources()
python_tests(name="tests")
python_tests(
name="tests",
overrides={
"rules_integration_test.py": {
"tags": ["platform_specific_behavior"],
}
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def test_passing(rule_runner: RuleRunner) -> None:
assert_success(rule_runner, tgt)


@pytest.mark.platform_specific_behavior
def test_failing(rule_runner: RuleRunner) -> None:
rule_runner.write_files({"Dockerfile": BAD_FILE, "BUILD": "docker_image(name='t')"})
tgt = rule_runner.get_target(Address("", target_name="t"))
Expand Down
10 changes: 9 additions & 1 deletion src/python/pants/backend/go/lint/golangci_lint/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_sources()
python_tests(name="tests", timeout=120)
python_tests(
name="tests",
timeout=120,
overrides={
"rules_integration_test.py": {
"tags": ["platform_specific_behavior"],
}
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def test_passing(rule_runner: RuleRunner) -> None:
assert lint_results[0].stderr == ""


@pytest.mark.platform_specific_behavior
def test_failing(rule_runner: RuleRunner) -> None:
rule_runner.write_files(
{
Expand Down
4 changes: 3 additions & 1 deletion src/python/pants_release/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Platform(Enum):
SELF_HOSTED = {Platform.LINUX_ARM64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
# We control these runners, so we preinstall and expose python on them.
HAS_PYTHON = {Platform.LINUX_ARM64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
HAS_GO = {Platform.MACOS12_X86_64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
CARGO_AUDIT_IGNORED_ADVISORY_IDS = (
"RUSTSEC-2020-0128", # returns a false positive on the cache crate, which is a local crate not a 3rd party crate
)
Expand Down Expand Up @@ -743,8 +744,9 @@ def test_jobs(
*checkout(),
*(launch_bazel_remote() if with_remote_caching else []),
install_jdk(),
*([install_go()] if helper.platform not in HAS_GO else []),
*(
[install_go(), download_apache_thrift()]
[download_apache_thrift()]
if helper.platform == Platform.LINUX_X86_64
# Other platforms either don't run those tests, or have the binaries
# preinstalled on the self-hosted runners.
Expand Down
Loading