Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ environment variables or a `.env` file at the project directory.
CORTEX_TEST_REALTIME_DEPLOY_TIMEOUT=60
CORTEX_TEST_BATCH_DEPLOY_TIMEOUT=30
CORTEX_TEST_BATCH_JOB_TIMEOUT=120
CORTEX_TEST_BATCH_S3_BUCKET_DIR=s3://<s3_bucket>/test/jobs
CORTEX_TEST_BATCH_S3_PATH=s3://<s3_bucket>/test/jobs
```
4 changes: 2 additions & 2 deletions test/e2e/e2e/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_realtime_api(client: cx.Client, api: str, timeout: int = None):
def test_batch_api(
client: cx.Client,
api: str,
test_bucket: str,
test_s3_path: str,
deploy_timeout: int = None,
job_timeout: int = None,
retry_attempts: int = 0,
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_batch_api(
api_name,
item_list=payload,
batch_size=2,
config={"dest_s3_dir": test_bucket},
config={"dest_s3_dir": test_s3_path},
)
if response.status_code == HTTPStatus.OK:
break
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/tests/aws/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
@pytest.mark.usefixtures("client")
@pytest.mark.parametrize("api", TEST_APIS)
def test_batch_api(config: Dict, client: cx.Client, api: str):
s3_bucket = config["aws"].get("s3_bucket")
if not s3_bucket:
s3_path = config["aws"].get("s3_path")
if not s3_path:
pytest.skip(
"--s3-bucket option is required to run batch tests (alternatively set the "
"CORTEX_TEST_BATCH_S3_BUCKET_DIR env var) )"
"--s3-path option is required to run batch tests (alternatively set the "
"CORTEX_TEST_BATCH_S3_PATH env var) )"
)

e2e.tests.test_batch_api(
client,
api,
test_bucket=s3_bucket,
test_s3_path=s3_path,
deploy_timeout=config["global"]["batch_deploy_timeout"],
job_timeout=config["global"]["batch_job_timeout"],
retry_attempts=5,
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ def pytest_addoption(parser):
help="set cortex GCP cluster config, to test on a new GCP cluster",
)
parser.addoption(
"--s3-bucket",
"--s3-path",
action="store",
default=None,
help="set s3 bucket where batch jobs results will be stored",
help="set s3 path where batch jobs results will be stored",
)


def pytest_configure(config):
load_dotenv(".env")

s3_bucket = os.environ.get("CORTEX_TEST_BATCH_S3_BUCKET_DIR")
s3_bucket = config.getoption("--s3-bucket") if not s3_bucket else s3_bucket
s3_path = os.environ.get("CORTEX_TEST_BATCH_S3_PATH")
s3_path = config.getoption("--s3-path") if not s3_path else s3_path

configuration = {
"aws": {
"env": config.getoption("--aws-env"),
"config": config.getoption("--aws-config"),
"s3_bucket": s3_bucket,
"s3_path": s3_path,
},
"gcp": {
"env": config.getoption("--gcp-env"),
Expand Down