-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathprofile_tests.sh
39 lines (37 loc) · 1.2 KB
/
profile_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
set -o pipefail
echo "Keywords expression for pytest (PYTEST_KEYWORDS): -k '$PYTEST_KEYWORDS'"
echo "Extra args for pytest (PYTEST_EXTRA_ARGS): $PYTEST_EXTRA_ARGS"
python -m venv ./venv
source ./venv/bin/activate
pip install '.[test]'
id
apt-get update
apt-get install -y sudo
sm-local-configure
source tests/generate_sagemaker_config.sh
source tests/generate_accelerate_config.sh
export DEBIAN_FRONTEND=noninteractive
apt-get install -y graphviz
export AWS_REGION=eu-west-1
export AWS_DEFAULT_REGION=eu-west-1
# shellcheck disable=SC2207
sts=( $(source tests/assume-user-role.sh) )
export AWS_ACCESS_KEY_ID=${sts[0]}
export AWS_SECRET_ACCESS_KEY=${sts[1]}
export AWS_SESSION_TOKEN=${sts[2]}
cd tests
apt-get install -y firefox-esr
export MOZ_HEADLESS=1
# shellcheck disable=SC2086
pytest \
-o sagemaker_studio_domain="$SAGEMAKER_STUDIO_DOMAIN" \
-o sagemaker_studio_vpc_only_domain="$SAGEMAKER_STUDIO_VPC_ONLY_DOMAIN" \
-o vpc_only_subnet="$VPC_ONLY_SUBNET" \
-o vpc_only_security_group="$VPC_ONLY_SECURITY_GROUP" \
-o sagemaker_role="$SAGEMAKER_ROLE" \
-o sns_notification_topic_arn="$SNS_NOTIFICATION_TOPIC_ARN" \
--profile --profile-svg \
-k "$PYTEST_KEYWORDS" $PYTEST_EXTRA_ARGS
cd -