Skip to content

Commit

Permalink
Improve end-to-end testing slightly (#1862)
Browse files Browse the repository at this point in the history
* CI: Run e2e tests with RUST_LOG=debug

* Move installing of pip packaged from CI to e2e script
  • Loading branch information
emilk authored Apr 17, 2023
1 parent 63f19e7 commit 87906dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,9 @@ jobs:
shell: bash
run: cd rerun_py/tests && pytest

- name: Install requriements for e2e test
run: |
pip install -r examples/python/api_demo/requirements.txt
pip install -r examples/python/car/requirements.txt
pip install -r examples/python/multithreading/requirements.txt
pip install -r examples/python/plots/requirements.txt
pip install -r examples/python/text_logging/requirements.txt
- name: Run e2e test
shell: bash
run: scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed
run: RUST_LOG=debug scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed

- name: Unpack the wheel
shell: bash
Expand Down Expand Up @@ -388,19 +380,10 @@ jobs:
shell: bash
run: cd rerun_py/tests && pytest

- name: Install requriements for e2e test
if: ${{ matrix.run_tests }}
run: |
pip install -r examples/python/api_demo/requirements.txt
pip install -r examples/python/car/requirements.txt
pip install -r examples/python/multithreading/requirements.txt
pip install -r examples/python/plots/requirements.txt
pip install -r examples/python/text_logging/requirements.txt
- name: Run e2e test
if: ${{ matrix.run_tests }}
shell: bash
run: scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed
run: RUST_LOG=debug scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed

- name: Unpack the wheel
shell: bash
Expand Down
18 changes: 18 additions & 0 deletions scripts/run_python_e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
def main() -> None:
parser = argparse.ArgumentParser(description="Logs Objectron data using the Rerun SDK.")
parser.add_argument("--no-build", action="store_true", help="Skip building rerun-sdk")
parser.add_argument("--no-pip-reqs", action="store_true", help="Skip installing pip requirements")

if parser.parse_args().no_build:
print("Skipping building rerun-sdk - assuming it is already built and up-to-date!")
Expand All @@ -38,6 +39,23 @@ def main() -> None:
print(f"rerun-sdk built in {elapsed:.1f} seconds")
print("")

if parser.parse_args().no_pip_reqs:
requirements = [
"examples/python/api_demo/requirements.txt",
"examples/python/car/requirements.txt",
"examples/python/multithreading/requirements.txt",
"examples/python/plots/requirements.txt",
"examples/python/text_logging/requirements.txt",
]

print("----------------------------------------------------------")
print("Installing pip dependencies…")
start_time = time.time()
for requirement in requirements:
subprocess.run(["pip", "install", "--quiet", "-r", requirement], check=True)
print(f"pip install in {elapsed:.1f} seconds")
print("")

examples = [
# Trivial examples that don't require weird dependencies, or downloading data
("examples/python/api_demo/main.py", ["--demo", "all"]),
Expand Down

0 comments on commit 87906dc

Please sign in to comment.