Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/build-virtualenv-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
schedule:
- cron: '0 4 * * MON'

permissions: {}

jobs:
build-lint-virtualenvs:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cleanup-pr-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ name: Delete closed PR container image tag
types:
- closed

permissions:
packages: write

jobs:
cleanup-pr-tag:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
branches:
- master

permissions: {}

jobs:
build-and-publish:
# Skip job on forks
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches:
- master

permissions: {}

jobs:
lints:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import stat
import sys

from datetime import datetime, timedelta
from datetime import datetime
from pathlib import Path
from typing import Optional
from unittest.mock import patch, MagicMock
Expand Down Expand Up @@ -276,6 +276,7 @@ def test_install_jb(config: Config, fs, capsys):
config.managed_tools = {}
_setup_tool_github_responses()
assert not tools.MANAGED_TOOLS_PATH.exists()
before_install = datetime.now().replace(microsecond=0)

tools.install_tool(config, "jb", None)

Expand All @@ -299,7 +300,10 @@ def test_install_jb(config: Config, fs, capsys):
assert len(state) == 1
assert "jb" in state
updated = datetime.fromisoformat(state["jb"])
assert datetime.now() - updated < timedelta(seconds=1)
# NOTE(sg): we're not checking timedelta here, instead we're verifying that the updated
# timestamp is between now and before we installed the tool.
assert datetime.now() > updated
assert updated >= before_install


@pytest.mark.skipif(
Expand Down
Loading