Skip to content

Commit

Permalink
drop buildkite pipeline (#10227)
Browse files Browse the repository at this point in the history
We have now fully migrated off buildkite, so let’s remove the old
pipeline from the repository :)
  • Loading branch information
Ekleog-NEAR authored Nov 28, 2023
1 parent 3a33ff5 commit cbd52ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 114 deletions.
87 changes: 0 additions & 87 deletions .buildkite/pipeline.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
pull_request:
merge_group:

# BE CAREFUL IF EDITING THIS FILE:
# If you add/remove python tests from here, you should also update `check_pytests.py`’s list of GHA_TESTS
# so that it stays in-sync, to make sure no tests are lost.

jobs:
cargo_nextest:
name: "Cargo Nextest (${{matrix.name}})"
Expand Down
38 changes: 11 additions & 27 deletions scripts/check_pytests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@

PYTEST_TESTS_DIRECTORY = pathlib.Path('pytest/tests')
NIGHTLY_TESTS_FILE = pathlib.Path(nayduck.DEFAULT_TEST_FILE)
BUILDKITE_PIPELINE_FILE = pathlib.Path('.buildkite/pipeline.yml')

# TODO: this should read ci.yml and fetch the list of tests from there
# Currently, the list of tests is hardcoded, so if a test is removed/added to ci.yml then the list
# here should be updated too
GHA_TESTS = [
"sanity/backward_compatible.py",
"sanity/db_migration.py",
"sanity/spin_up_cluster.py",
"sanity/upgradable.py",
]

StrGenerator = typing.Generator[str, None, None]

Expand Down Expand Up @@ -91,31 +100,6 @@ def extract_name(line: str) -> StrGenerator:
found_todo = False


def read_pipeline_tests(filename: pathlib.Path) -> StrGenerator:
"""Reads pytest tests mentioned in Buildkite pipeline file.
The parsing of the pipeline configuration is quite naive. All this function
is looking for is a "cd pytest" line in a step's command followed by
"python3 tests/<name>" lines. The <name> is yielded for each such line.
Args:
filename: Path to the Buildkite pipeline configuration file.
Yields:
pytest tests mentioned in the commands in the configuration file.
"""
with open(filename) as rd:
data = yaml.load(rd, Loader=yaml.SafeLoader)
for step in data.get('steps', ()):
in_pytest = False
for line in step.get('command', '').splitlines():
line = line.strip()
line = re.sub(r'\s+', ' ', line)
if line == 'cd pytest':
in_pytest = True
elif in_pytest and line.startswith('python3 tests/'):
yield line.split()[1][6:]


def print_error(missing: typing.Collection[str]) -> None:
"""Formats and outputs an error message listing missing tests."""
this_file = os.path.relpath(__file__)
Expand Down Expand Up @@ -164,7 +148,7 @@ def main() -> int:
count = len(missing)
missing.difference_update(
read_nayduck_tests(pathlib.Path(nayduck.DEFAULT_TEST_FILE)))
missing.difference_update(read_pipeline_tests(BUILDKITE_PIPELINE_FILE))
missing.difference_update(GHA_TESTS)
missing = set(filename for filename in missing if not any(
fnmatch.fnmatch(filename, pattern) for pattern in HELPER_SCRIPTS))
if missing:
Expand Down

0 comments on commit cbd52ee

Please sign in to comment.