Script tmnet
provides possibility to store and manage testmon data files
on S3 Bucket. S3 storage is organized into environments. Each environment
contains unique string to identify environment i.e. linux-py39
.
Cached files in an environment are not shared with other environments.
S3 Bucket contains one “cache index files” (_tmnet.json). This json
file contains a dict where top level keys are a abbreviated Git SHA
codes (as given git log --oneline
).
The values are the list of filenames that were cached. on S3 the file
name is given by <sha>_<filename>
.
There are 2 supported operations:
_tmnet.json
).Just add next section to your pytest.ini
file
[pytest.tmnet]
TMNET_S3_REGION = us
TMNET_S3_ENDPOINT = https://s3endpoint.com
TMNET_S3_BUCKET = bucket_name
TMNET_S3_ACCESS_ID = XXXXXXXXXXXXXXXXXXXX
TMNET_S3_SECRET_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Please, note if argument is provided it overwrites related value in pytest.ini
.
option | help |
---|---|
--upload | Flag. If provided then tmnet will upload data file to S3 Bucket. |
--s3-bucket | S3 Bucket name, use unique identifier for project. |
--s3-access-id | S3 access ID. |
--s3-secret | S3 secret key. |
--s3-region | S3 region name. |
--s3-endpoint | S3 endpoint link. |
tmnet linux-py39 # will download testmon data file from S3 bucket.
tmnet linux-py39 --upload # will upload testmon data file to S3 bucket specified in pytest.ini.
tmnet linux-py39 --s3-bucket=mybucket # will upload testmon data file to S3 bucket with name 'mybucket'.
option | help |
---|---|
TMNET_S3_SECRET_KEY | If provided overwrites TMNET_S3_SECRET_KEY provided in pytest.ini and --s3-secret argument. |