Skip to content
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

[Test-Only] #2066

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ runs:
migration_mode: ${{ inputs.migration_mode }}
pg_old_dir: ${{ inputs.pg_old_dir }}
pg_new_dir: ${{ inputs.pg_new_dir }}
db_parameters: ${{ matrix.upgrade-path.db_parameters }}

- name: Run JDBC Verify Tests
if: always() && inputs.is_final_ver == 'true'
Expand Down
14 changes: 13 additions & 1 deletion .github/composite-actions/run-pg-upgrade/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
description: "Current postgres intall directory"
required: false
default: postgres14
db_parameters:
description: "DB parameters which need to be set in postgresql.conf"
required: false
default: "()"

runs:
using: "composite"
Expand All @@ -32,12 +36,20 @@ runs:
echo 'Updating babelfish extensions...'
cd ~/work/babelfish_extensions/babelfish_extensions/
~/${{ inputs.pg_new_dir }}/bin/pg_ctl -D ~/${{ inputs.pg_new_dir }}/data -l ~/${{ inputs.pg_new_dir }}/data/logfile14 start
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "ALTER EXTENSION babelfishpg_common UPDATE; ALTER EXTENSION babelfishpg_tsql UPDATE;"
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "ALTER EXTENSION babelfishpg_common UPDATE;"
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "ALTER EXTENSION babelfishpg_tsql UPDATE;"
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "\dx"
echo 'Reset bbf database settings...'
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "ALTER SYSTEM SET babelfishpg_tsql.database_name = 'jdbc_testdb';"
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "ALTER SYSTEM SET babelfishpg_tsql.migration_mode = '${{inputs.migration_mode}}';"
sudo ~/${{ inputs.pg_new_dir }}/bin/psql -d jdbc_testdb -U runner -c "SELECT pg_reload_conf();"

DB_PARAMETERS=${{ inputs.db_parameters }}
for DB_PARAMETER in ${DB_PARAMETERS[@]}; do
sudo echo $DB_PARAMETER >> ~/${{ inputs.pg_new_dir }}/data/postgresql.conf
done
~/${{ inputs.pg_new_dir }}/bin/pg_ctl -D ~/${{ inputs.pg_new_dir }}/data -l ~/${{ inputs.pg_new_dir }}/data/logfile14 restart

export PATH=/opt/mssql-tools/bin:$PATH
sqlcmd -S localhost -U jdbc_user -P 12345678 -Q "SELECT @@version GO"
shell: bash
4 changes: 4 additions & 0 deletions .github/composite-actions/setup-base-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ runs:
sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'babelfishpg_tds'/g" postgresql.conf
ipaddress=$(ifconfig eth0 | grep 'inet ' | cut -d: -f2 | awk '{ print $2}')
sudo echo "host all all $ipaddress/32 trust" >> pg_hba.conf
DB_PARAMETERS=${{ matrix.upgrade-path.db_parameters }}
for DB_PARAMETER in ${DB_PARAMETERS[@]}; do
sudo echo $DB_PARAMETER >> postgresql.conf
done
~/${{ inputs.install_dir }}/bin/pg_ctl -D ~/${{ inputs.install_dir }}/data/ -l logfile restart
sudo ~/${{ inputs.install_dir }}/bin/psql -d postgres -U runner -c "CREATE USER jdbc_user WITH SUPERUSER CREATEDB CREATEROLE PASSWORD '12345678' INHERIT;"
sudo ~/${{ inputs.install_dir }}/bin/psql -d postgres -U runner -c "DROP DATABASE IF EXISTS jdbc_testdb;"
Expand Down
6 changes: 3 additions & 3 deletions .github/composite-actions/setup-upgrade-version-ca/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
printf 'name: "Upgrade till final version and run verify tests"\nruns:\n using: "composite"\n steps:\n' > $upgrade_version_dir_path/action.yml

# Length of the upgrade path
LEN=$(yq '."upgrade-version"[${{ matrix.upgrade-path.id }}] | length' ${{ github.workspace }}/.github/configuration/upgrade-test-configuration.yml)
LEN=$(yq '."upgrade-version"[${{ matrix.upgrade-path.id }}]."upgrade-path" | length' ${{ github.workspace }}/.github/configuration/upgrade-test-configuration.yml)
if [[ $LEN -le 1 ]]
then
echo "ERROR: Upgrade path length less than 2" 1>&2
Expand All @@ -32,7 +32,7 @@ runs:
for (( i=1 ; i<$LEN ; i++ ));
do
# Computing input parameters that need to pass
version_var=".\"upgrade-version\"[${{ matrix.upgrade-path.id }}][$i].version"
version_var=".\"upgrade-version\"[${{ matrix.upgrade-path.id }}].\"upgrade-path\"[$i].version"
upgrade_version=$(yq $version_var ${{ github.workspace }}/.github/configuration/upgrade-test-configuration.yml)
upgrade_version_engb=".\""${upgrade_version}"\".engine_branch"
engine_branch=$(yq $upgrade_version_engb ${{ github.workspace }}/.github/template/version-branch-template.yml)
Expand All @@ -42,7 +42,7 @@ runs:
pg_old_dir=$(echo postgres$(awk -F. '{print $1}' <<< $previous_installed_version))
pg_new_dir=$(echo postgres$(awk -F. '{print $1}' <<< $upgrade_version))

upgrade_type_var=".\"upgrade-version\"[${{ matrix.upgrade-path.id }}][$i].\"upgrade-type\""
upgrade_type_var=".\"upgrade-version\"[${{ matrix.upgrade-path.id }}].\"upgrade-path\"[$i].\"upgrade-type\""
upgrade_type=$(yq $upgrade_type_var ${{ github.workspace }}/.github/configuration/upgrade-test-configuration.yml)
uses_file=./.github/composite-actions/$upgrade_type-version-upgrade-util

Expand Down
268 changes: 160 additions & 108 deletions .github/configuration/upgrade-test-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,108 +1,160 @@
upgrade-version: [[
{
version: 13.6,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 14.3,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
],
[
{
version: 14.5,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
],
[
{
version: '14.10',
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
],
[
{
version: source.latest,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 13.4,
upgrade-type: null
},
{
version: 13.9,
upgrade-type: minor
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 13.5,
upgrade-type: null
},
{
version: 13.9,
upgrade-type: minor
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 13.7,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 13.8,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 13.9,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
]]
upgrade-version: [
{
upgrade-path: [
{
version: 13.6,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 14.3,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
]
},
{
upgrade-path: [
{
version: 14.5,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
]
},
{
upgrade-path: [
{
version: '14.10',
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
]
},
{
upgrade-path: [
{
version: source.latest,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 13.4,
upgrade-type: null
},
{
version: 13.9,
upgrade-type: minor
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 13.5,
upgrade-type: null
},
{
version: 13.9,
upgrade-type: minor
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 13.7,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 13.8,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 13.9,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
]
},
{
upgrade-path: [
{
version: 13.6,
upgrade-type: null,
},
{
version: target.latest,
upgrade-type: major,
}
],
db-parameters: [
"babelfishpg_tsql.server_collation_name = 'chinese_prc_ci_as'"
]
},
{
upgrade-path: [
{
version: 13.9,
upgrade-type: null,
},
{
version: target.latest,
upgrade-type: major,
}
],
db-parameters: [
"babelfishpg_tsql.server_collation_name = 'chinese_prc_ci_as'"
]
}
]
Loading
Loading