Skip to content

Commit 87e919b

Browse files
committed
Testing macos
1 parent 8e2ec56 commit 87e919b

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

.github/workflows/tests.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,22 @@ jobs:
4242
runs-on: ${{ matrix.os }}
4343
steps:
4444
- uses: actions/checkout@v4
45-
45+
- name: Install Redis (macOS)
46+
if: runner.os == 'macOS'
47+
shell: bash -euxo pipefail {0}
48+
run: |
49+
# Extract major version (e.g., 8.4.0 -> 8)
50+
MAJOR_VERSION=$(echo "${{ env.REDIS_VERSION }}" | cut -d. -f1)
51+
52+
# Check if a specific versioned formula exists, otherwise use latest
53+
if brew info "redis@$MAJOR_VERSION" >/dev/null 2>&1; then
54+
brew install "redis@$MAJOR_VERSION"
55+
brew services start "redis@$MAJOR_VERSION"
56+
echo "$(brew --prefix "redis@$MAJOR_VERSION")/bin" >> $GITHUB_PATH
57+
else
58+
brew install redis
59+
brew services start redis
60+
fi
4661
- name: Run Test Suite
4762
uses: ./.github/actions/tests
4863
with:

tests/conftest.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,12 @@ class TestEnv:
2121
TestEnvFixture = Annotated[TestEnv, pytest.fixture]
2222

2323

24-
@pytest.fixture(scope="session")
25-
def redis_container() -> Iterator[RedisContainer]:
26-
with RedisContainer(f"redis:{REDIS_VERSION}") as container:
27-
yield container
28-
29-
3024
@pytest.fixture
31-
def test_env(redis_container: RedisContainer):
32-
host = redis_container.get_container_host_ip()
33-
port = int(redis_container.get_exposed_port(redis_container.port))
34-
35-
redis_url: str = f"redis://{host}:{port}"
36-
37-
redis_client: Redis = Redis(host=host, port=port)
25+
def test_env():
26+
redis_client: Redis = Redis()
3827
redis_client.flushall()
3928

40-
fluxqueue: FluxQueue = FluxQueue(redis_url=redis_url)
29+
fluxqueue: FluxQueue = FluxQueue()
4130

4231
try:
4332
yield TestEnv(fluxqueue=fluxqueue, redis_client=redis_client)

0 commit comments

Comments
 (0)