Skip to content

Commit c1a15d1

Browse files
committed
refactor(tests/nixos/s3-binary-cache-store): rename with_test_bucket to setup_s3
1 parent 22f4ccc commit c1a15d1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/nixos/s3-binary-cache-store.nix

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ in
135135
print(output)
136136
raise Exception(f"{error_msg}: expected {expected}, got {actual}")
137137
138-
def with_test_bucket(populate_with=[]):
138+
def setup_s3(populate_with=[]):
139139
"""
140140
Decorator that creates/destroys a unique bucket for each test.
141141
Optionally pre-populates bucket with specified packages.
@@ -162,7 +162,7 @@ in
162162
# Test Functions
163163
# ============================================================================
164164
165-
@with_test_bucket()
165+
@setup_s3()
166166
def test_credential_caching(bucket):
167167
"""Verify credential providers are cached and reused"""
168168
print("\n=== Testing Credential Caching ===")
@@ -182,7 +182,7 @@ in
182182
183183
print("✓ Credential provider created once and cached")
184184
185-
@with_test_bucket(populate_with=[PKGS['A']])
185+
@setup_s3(populate_with=[PKGS['A']])
186186
def test_fetchurl_basic(bucket):
187187
"""Test builtins.fetchurl works with s3:// URLs"""
188188
print("\n=== Testing builtins.fetchurl ===")
@@ -198,7 +198,7 @@ in
198198
199199
print("✓ builtins.fetchurl works with s3:// URLs")
200200
201-
@with_test_bucket()
201+
@setup_s3()
202202
def test_error_message_formatting(bucket):
203203
"""Verify error messages display URLs correctly"""
204204
print("\n=== Testing Error Message Formatting ===")
@@ -218,7 +218,7 @@ in
218218
219219
print("✓ Error messages format URLs correctly")
220220
221-
@with_test_bucket(populate_with=[PKGS['A']])
221+
@setup_s3(populate_with=[PKGS['A']])
222222
def test_fork_credential_preresolution(bucket):
223223
"""Test credential pre-resolution in forked processes"""
224224
print("\n=== Testing Fork Credential Pre-resolution ===")
@@ -298,7 +298,7 @@ in
298298
299299
print(" ✓ Child uses pre-resolved credentials (no new providers)")
300300
301-
@with_test_bucket(populate_with=[PKGS['A'], PKGS['B'], PKGS['C']])
301+
@setup_s3(populate_with=[PKGS['A'], PKGS['B'], PKGS['C']])
302302
def test_store_operations(bucket):
303303
"""Test nix store info and copy operations"""
304304
print("\n=== Testing Store Operations ===")
@@ -337,7 +337,7 @@ in
337337
print(" ✓ nix copy works")
338338
print(" ✓ Credentials cached on client")
339339
340-
@with_test_bucket(populate_with=[PKGS['A']])
340+
@setup_s3(populate_with=[PKGS['A']])
341341
def test_url_format_variations(bucket):
342342
"""Test different S3 URL parameter combinations"""
343343
print("\n=== Testing URL Format Variations ===")
@@ -352,7 +352,7 @@ in
352352
client.succeed(f"{ENV_WITH_CREDS} nix store info --store '{url2}' >&2")
353353
print(" ✓ Parameter order: endpoint before region works")
354354
355-
@with_test_bucket(populate_with=[PKGS['A']])
355+
@setup_s3(populate_with=[PKGS['A']])
356356
def test_concurrent_fetches(bucket):
357357
"""Validate thread safety with concurrent S3 operations"""
358358
print("\n=== Testing Concurrent Fetches ===")
@@ -414,7 +414,7 @@ in
414414
f"Expected 5 FileTransfer instances for 5 concurrent fetches, got {transfers_created}"
415415
)
416416
417-
@with_test_bucket()
417+
@setup_s3()
418418
def test_compression_narinfo_gzip(bucket):
419419
"""Test narinfo compression with gzip"""
420420
print("\n=== Testing Compression: narinfo (gzip) ===")
@@ -433,7 +433,7 @@ in
433433
434434
print(" ✓ Client decompressed .narinfo successfully")
435435
436-
@with_test_bucket()
436+
@setup_s3()
437437
def test_compression_mixed(bucket):
438438
"""Test mixed compression (narinfo=xz, ls=gzip)"""
439439
print("\n=== Testing Compression: mixed (narinfo=xz, ls=gzip) ===")
@@ -461,7 +461,7 @@ in
461461
462462
print(" ✓ Client downloaded package with mixed compression")
463463
464-
@with_test_bucket()
464+
@setup_s3()
465465
def test_compression_disabled(bucket):
466466
"""Verify no compression by default"""
467467
print("\n=== Testing Compression: disabled (default) ===")

0 commit comments

Comments
 (0)