-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make export-dir, source and target databases dynamic to enable parallel runs #2019
Conversation
shubham-yb
commented
Dec 1, 2024
•
edited
Loading
edited
- Added a dynamically named export dir for each test
- Added the provision to create a different source db for each Oracle test
|
if [[ "${SOURCE_DB_TYPE}" == "postgresql" || "${SOURCE_DB_TYPE}" == "mysql" ]]; then | ||
export SOURCE_DB_NAME=${SOURCE_DB_NAME:-"${NORMALIZED_TEST_NAME}_fallb"} | ||
elif [[ "${SOURCE_DB_TYPE}" == "oracle" ]]; then | ||
export SOURCE_DB_SCHEMA=${SOURCE_DB_SCHEMA:-"${NORMALIZED_TEST_NAME:0:10}_fallb"} && export SOURCE_DB_SCHEMA=${SOURCE_DB_SCHEMA^^} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why :0:10
? pls add a comment.
what is ^^?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ^^ to make the schema uppercase
@@ -18,7 +18,7 @@ export REPO_ROOT="${PWD}" | |||
export SCRIPTS="${REPO_ROOT}/migtests/scripts" | |||
export TESTS_DIR="${REPO_ROOT}/migtests/tests" | |||
export TEST_DIR="${TESTS_DIR}/${TEST_NAME}" | |||
export EXPORT_DIR=${EXPORT_DIR:-"${TEST_DIR}/export-dir"} | |||
export NORMALIZED_TEST_NAME="$(echo "$TEST_NAME" | tr '/-' '_')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do we get TEST_NAME
from to begin with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEST_NAME is passed during the test invocation.
The general pattern is TEST_SCRIPT TEST_NAME
example: run_test.sh pg/datatypes
@@ -37,6 +37,20 @@ else | |||
source ${SCRIPTS}/${SOURCE_DB_TYPE}/env.sh | |||
fi | |||
|
|||
export EXPORT_DIR=${EXPORT_DIR:-"${TEST_DIR}/${NORMALIZED_TEST_NAME}_live_export-dir"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this code is the same for all tests?
if so, can we write this logic in functions.sh? (for determining exportDir, setting SOURCE_DB_NAME, etc.
After the merge of b7f29af |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! pls remove the commented code before merging.
oracle) | ||
# Limit schema name to 10 characters for Oracle/Debezium due to 30 character limit | ||
export SOURCE_DB_SCHEMA=${SOURCE_DB_SCHEMA:-"${NORMALIZED_TEST_NAME:0:10}_${test_suffix}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can do the truncate 0:10 also above when generating NORMALIZED_TEST_NAME.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping it specific to Oracle for now. The longer export-dir name brought out some issues. It'll be good to have that test case.
This reverts commit 0c88b8a.