Skip to content

Commit

Permalink
added testframework to check
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Bhagat committed Nov 24, 2023
1 parent 077febc commit a5b9004
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 115 deletions.
3 changes: 2 additions & 1 deletion .github/composite-actions/run-pg-upgrade/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ 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';"
Expand Down
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
4 changes: 2 additions & 2 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 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

0 comments on commit a5b9004

Please sign in to comment.