|
135 | 135 | print(output) |
136 | 136 | raise Exception(f"{error_msg}: expected {expected}, got {actual}") |
137 | 137 |
|
138 | | - def setup_s3(populate_with=[]): |
| 138 | + def setup_s3(populate_bucket=[]): |
139 | 139 | """ |
140 | 140 | Decorator that creates/destroys a unique bucket for each test. |
141 | 141 | Optionally pre-populates bucket with specified packages. |
142 | 142 |
|
143 | 143 | Args: |
144 | | - populate_with: List of packages to upload before test runs |
| 144 | + populate_bucket: List of packages to upload before test runs |
145 | 145 | """ |
146 | 146 | def decorator(test_func): |
147 | 147 | def wrapper(): |
148 | 148 | bucket = str(uuid.uuid4()) |
149 | 149 | server.succeed(f"mc mb minio/{bucket}") |
150 | 150 | try: |
151 | | - if populate_with: |
| 151 | + if populate_bucket: |
152 | 152 | store_url = make_s3_url(bucket) |
153 | | - for pkg in populate_with: |
| 153 | + for pkg in populate_bucket: |
154 | 154 | server.succeed(f"{ENV_WITH_CREDS} nix copy --to '{store_url}' {pkg}") |
155 | 155 | test_func(bucket) |
156 | 156 | finally: |
|
182 | 182 |
|
183 | 183 | print("✓ Credential provider created once and cached") |
184 | 184 |
|
185 | | - @setup_s3(populate_with=[PKGS['A']]) |
| 185 | + @setup_s3(populate_bucket=[PKGS['A']]) |
186 | 186 | def test_fetchurl_basic(bucket): |
187 | 187 | """Test builtins.fetchurl works with s3:// URLs""" |
188 | 188 | print("\n=== Testing builtins.fetchurl ===") |
|
218 | 218 |
|
219 | 219 | print("✓ Error messages format URLs correctly") |
220 | 220 |
|
221 | | - @setup_s3(populate_with=[PKGS['A']]) |
| 221 | + @setup_s3(populate_bucket=[PKGS['A']]) |
222 | 222 | def test_fork_credential_preresolution(bucket): |
223 | 223 | """Test credential pre-resolution in forked processes""" |
224 | 224 | print("\n=== Testing Fork Credential Pre-resolution ===") |
|
298 | 298 |
|
299 | 299 | print(" ✓ Child uses pre-resolved credentials (no new providers)") |
300 | 300 |
|
301 | | - @setup_s3(populate_with=[PKGS['A'], PKGS['B'], PKGS['C']]) |
| 301 | + @setup_s3(populate_bucket=[PKGS['A'], PKGS['B'], PKGS['C']]) |
302 | 302 | def test_store_operations(bucket): |
303 | 303 | """Test nix store info and copy operations""" |
304 | 304 | print("\n=== Testing Store Operations ===") |
|
337 | 337 | print(" ✓ nix copy works") |
338 | 338 | print(" ✓ Credentials cached on client") |
339 | 339 |
|
340 | | - @setup_s3(populate_with=[PKGS['A']]) |
| 340 | + @setup_s3(populate_bucket=[PKGS['A']]) |
341 | 341 | def test_url_format_variations(bucket): |
342 | 342 | """Test different S3 URL parameter combinations""" |
343 | 343 | print("\n=== Testing URL Format Variations ===") |
|
352 | 352 | client.succeed(f"{ENV_WITH_CREDS} nix store info --store '{url2}' >&2") |
353 | 353 | print(" ✓ Parameter order: endpoint before region works") |
354 | 354 |
|
355 | | - @setup_s3(populate_with=[PKGS['A']]) |
| 355 | + @setup_s3(populate_bucket=[PKGS['A']]) |
356 | 356 | def test_concurrent_fetches(bucket): |
357 | 357 | """Validate thread safety with concurrent S3 operations""" |
358 | 358 | print("\n=== Testing Concurrent Fetches ===") |
|
0 commit comments