Dependency-hungry testing helpers
Project description
coveo-testing-extras
Contains extra testing tools without dependency restrictions.
temporary resource implementation: Docker Container
The docker container temporary resource can be used to prepare short-lived containers.
- Supports building from a dockerfile
- Supports pulling images
- Can signal on AWS ECR logout
- Dynamic port mapping retrieval
- Saves log output before removing the container
Automatic AWS ECR login example
Here's how you can enhance TemporaryDockerContainerResource with automatic ECR login:
from base64 import b64decode
import boto3
from coveo_testing_extras.temporary_resource.docker_container import (
TemporaryDockerContainerResource,
ECRLogoutException,
get_docker_client
)
class WithECR(TemporaryDockerContainerResource):
def obtain_image(self) -> None:
try:
super().obtain_image()
except ECRLogoutException:
self._do_ecr_login()
super().obtain_image()
def _do_ecr_login(self) -> None:
""" Performs an ecr login through awscli. """
assert self.ecr_region
ecr = boto3.client('ecr')
account_id, *_ = self.image_name.split('.')
assert account_id.isdigit()
authorization_data = ecr.get_authorization_token(registryIds=[account_id])['authorizationData'][0]
username, password = b64decode(authorization_data['authorizationToken']).decode().split(':')
with get_docker_client() as client:
login = client.login(username=username, password=password, registry=authorization_data['proxyEndpoint'])
assert login['Status'] == 'Login Succeeded'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coveo_testing_extras-4.0.tar.gz.
File metadata
- Download URL: coveo_testing_extras-4.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb86eb205471fe64c9c635a3161c6d2df4b7bf53faebdf5547887912e5244edb
|
|
| MD5 |
c4480e49d2b920727b3b2dc5dab59f58
|
|
| BLAKE2b-256 |
5c6544c360d1f01355d459a21d86b0ea92d8082c12b5cd4321dac4aee85d6c16
|
Provenance
The following attestation bundles were made for coveo_testing_extras-4.0.tar.gz:
Publisher:
coveo-testing-extras.yml on coveooss/coveo-python-oss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coveo_testing_extras-4.0.tar.gz -
Subject digest:
eb86eb205471fe64c9c635a3161c6d2df4b7bf53faebdf5547887912e5244edb - Sigstore transparency entry: 2165078846
- Sigstore integration time:
-
Permalink:
coveooss/coveo-python-oss@68ac49e218f5955a2775103dba55b07aaaef42f1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/coveooss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
coveo-testing-extras.yml@68ac49e218f5955a2775103dba55b07aaaef42f1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file coveo_testing_extras-4.0-py3-none-any.whl.
File metadata
- Download URL: coveo_testing_extras-4.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c1cea3c4df4e5927a57a278b7e1811585e2dc0f2b28e9bfb5d09810788ed166
|
|
| MD5 |
fbedec99578371828d232f5b02dd5eb5
|
|
| BLAKE2b-256 |
c8d6f6ef5b50bb0b5569133ff23e9bb5ab08f4bb8192b2a9fa6761225ee9d433
|
Provenance
The following attestation bundles were made for coveo_testing_extras-4.0-py3-none-any.whl:
Publisher:
coveo-testing-extras.yml on coveooss/coveo-python-oss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coveo_testing_extras-4.0-py3-none-any.whl -
Subject digest:
2c1cea3c4df4e5927a57a278b7e1811585e2dc0f2b28e9bfb5d09810788ed166 - Sigstore transparency entry: 2165078851
- Sigstore integration time:
-
Permalink:
coveooss/coveo-python-oss@68ac49e218f5955a2775103dba55b07aaaef42f1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/coveooss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
coveo-testing-extras.yml@68ac49e218f5955a2775103dba55b07aaaef42f1 -
Trigger Event:
push
-
Statement type: