Skip to content

feature(aws-unittests): new unit test module for test aws services #9910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 12, 2025
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
18 changes: 0 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,6 @@ pipeline {
}
}
}
stage("run mocked tests") {
options {
timeout(time: 10, unit: 'MINUTES')
}
steps {
script {
try {
sh ''' ./docker/env/hydra.sh run-aws-mock -r us-east-1 '''
sleep 10 // seconds
sh ''' ./docker/env/hydra.sh --aws-mock run-pytest functional_tests/mocked '''
pullRequestSetResult('success', 'jenkins/mocked_tests', 'All mocked tests are passed')
} catch(Exception ex) {
pullRequestSetResult('failure', 'jenkins/mocked_tests', 'Some mocked tests failed')
}
sh ''' ./docker/env/hydra.sh clean-aws-mocks '''
}
}
}
stage("integration tests") {
when {
expression {
Expand Down
22 changes: 0 additions & 22 deletions docker/env/hydra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CREATE_RUNNER_INSTANCE=""
RUNNER_IP_FILE="${SCT_DIR}/sct_runner_ip"
RUNNER_IP=""
RUNNER_CMD=""
AWS_MOCK=""

HYDRA_DRY_RUN=""
HYDRA_HELP=""
Expand Down Expand Up @@ -55,10 +54,6 @@ while [[ $# -gt 0 ]]; do
RUNNER_IP="$2"
shift 2
;;
--aws-mock)
AWS_MOCK="1"
shift
;;
--dry-run-hydra)
HYDRA_DRY_RUN="1"
shift
Expand Down Expand Up @@ -371,23 +366,6 @@ fi

PREPARE_CMD="test"

if [[ -n "${AWS_MOCK}" ]]; then
if [[ -z "${HYDRA_DRY_RUN}" ]]; then
AWS_MOCK_IP=$(${RUNNER_CMD} cat aws_mock_ip)
MOCKED_HOSTS=$(${RUNNER_CMD} openssl s_client -connect "${AWS_MOCK_IP}:443" </dev/null 2>/dev/null \
| openssl x509 -noout -text \
| grep -Po '(?<=DNS:)[^,]+')
else
AWS_MOCK_IP=127.0.0.1
MOCKED_HOSTS="aws-mock.itself scylla-qa-keystore.s3.amazonaws.com ec2.eu-west-2.amazonaws.com"
fi
for host in ${MOCKED_HOSTS}; do
echo "Mock requests to ${host} using ${AWS_MOCK_IP}"
DOCKER_ADD_HOST_ARGS+=(--add-host "${host}:${AWS_MOCK_IP}")
done
PREPARE_CMD+="; curl -sSk https://aws-mock.itself/install-ca.sh | bash"
fi

COMMAND=${HYDRA_COMMAND[0]}

if [[ "$COMMAND" == *'bash'* ]] || [[ "$COMMAND" == *'python'* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/env/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.91-jinja2-v3.1.6
1.93-PR9910-e3c0cbb
12 changes: 0 additions & 12 deletions functional_tests/mocked/__init__.py

This file was deleted.

41 changes: 0 additions & 41 deletions functional_tests/mocked/conftest.py

This file was deleted.

23 changes: 0 additions & 23 deletions functional_tests/mocked/test_aws_region.py

This file was deleted.

1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fabric==3.2.2
invoke==2.2.0
boto3==1.28.4
boto3-stubs[s3,ec2,dynamodb,pricing]==1.28.4
moto[server]==5.1.1
awscli==1.29.4
aexpect==1.6.2
scylla-driver==3.29.2
Expand Down
Loading