Skip to content

Commit

Permalink
Remove get_self_dir()
Browse files Browse the repository at this point in the history
It didn't serve much value, and was only used twice.
Path(__file__).parent is a pretty easy invocation to use.

Signed-off-by: Tristan Partin <[email protected]>
  • Loading branch information
tristan957 authored Oct 8, 2024
1 parent 18b9715 commit 16417d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
3 changes: 1 addition & 2 deletions test_runner/fixtures/neon_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
allure_attach_from_dir,
assert_no_errors,
get_dir_size,
get_self_dir,
print_gc_result,
subprocess_capture,
wait_until,
Expand Down Expand Up @@ -130,7 +129,7 @@
@pytest.fixture(scope="session")
def base_dir() -> Iterator[Path]:
# find the base directory (currently this is the git root)
base_dir = get_self_dir().parent.parent
base_dir = Path(__file__).parents[2]
log.info(f"base_dir is {base_dir}")

yield base_dir
Expand Down
5 changes: 0 additions & 5 deletions test_runner/fixtures/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
Fn = TypeVar("Fn", bound=Callable[..., Any])


def get_self_dir() -> Path:
"""Get the path to the directory where this script lives."""
return Path(__file__).resolve().parent


def subprocess_capture(
capture_dir: Path,
cmd: List[str],
Expand Down
4 changes: 2 additions & 2 deletions test_runner/performance/test_perf_olap.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import os
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Tuple

import pytest
from _pytest.mark import ParameterSet
from fixtures.compare_fixtures import RemoteCompare
from fixtures.log_helper import log
from fixtures.utils import get_self_dir


@dataclass
Expand Down Expand Up @@ -191,7 +191,7 @@ def tpch_queuies() -> Tuple[ParameterSet, ...]:
- querues in returning tuple are ordered by the query number
- pytest parameters id is adjusted to match the query id (the numbering starts from 1)
"""
queries_dir = get_self_dir().parent / "performance" / "tpc-h" / "queries"
queries_dir = Path(__file__).parent / "performance" / "tpc-h" / "queries"
assert queries_dir.exists(), f"TPC-H queries dir not found: {queries_dir}"

return tuple(
Expand Down

1 comment on commit 16417d9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5085 tests run: 4878 passed, 0 failed, 207 skipped (full report)


Code coverage* (full report)

  • functions: 31.4% (7508 of 23933 functions)
  • lines: 49.6% (60282 of 121609 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
16417d9 at 2024-10-08T14:54:26.595Z :recycle:

Please sign in to comment.