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

fix: updates GitHub Actions runner image and restart policy #255

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
run: make test

e2e-test:
runs-on: ubuntu-latest
runs-on: 'ubuntu-24.04'
permissions:
contents: read
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ concurrency:

jobs:
publish-image:
runs-on: 'ubuntu-latest'
runs-on: 'ubuntu-24.04'
permissions:
contents: read
# kics-scan ignore-line
Expand Down
24 changes: 12 additions & 12 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import argparse
import logging
import pathlib
from tempfile import TemporaryDirectory
import tempfile
from typing import Any, Dict, Generator, Tuple, TypeVar

import pytest
Expand Down Expand Up @@ -36,23 +36,23 @@
@pytest.fixture(scope="function")
def tmp_repo() -> YieldFixture[Tuple[str, Repo]]:
"""Create a temporary git repository with an initialized trestle workspace root"""
with TemporaryDirectory(prefix=_TEST_PREFIX) as tmpdir:
tmp_path = pathlib.Path(tmpdir)
repo: Repo = repo_setup(tmp_path)
remote_url = "http://localhost:8080/test.git"
repo.create_remote("origin", url=remote_url)
yield tmpdir, repo
tmpdir = tempfile.mkdtemp(prefix=_TEST_PREFIX)
tmp_path = pathlib.Path(tmpdir)
repo: Repo = repo_setup(tmp_path)
remote_url = "http://localhost:8080/test.git"
repo.create_remote("origin", url=remote_url)
yield tmpdir, repo

try:
clean(tmpdir, repo)
except Exception as e:
logging.error(f"Failed to clean up temporary git repository: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

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

@jpower432 should this use a logger instance vs logging?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I think the logging statement should be removed here. It was left in for temporary debugging for an issue that this change resolves.

try:
clean(tmpdir, repo)
except Exception as e:
logging.error(f"Failed to clean up temporary git repository: {e}")
gvauter marked this conversation as resolved.
Show resolved Hide resolved


@pytest.fixture(scope="function")
def tmp_trestle_dir() -> YieldFixture[str]:
"""Create an initialized temporary trestle directory"""
with TemporaryDirectory(prefix=_TEST_PREFIX) as tmpdir:
with tempfile.TemporaryDirectory(prefix=_TEST_PREFIX) as tmpdir:
tmp_path = pathlib.Path(tmpdir)
try:
args = argparse.Namespace(
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/e2e_testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def build_test_command(
E2ETestRunner.TRESTLEBOT_TEST_POD_NAME,
"--entrypoint",
f"trestlebot-{command_name}",
"--rm",
"--restart",
"never",
]

# Add mounts
Expand Down