Re-enable postgres migration tests (#28270)

* Utilize separate image for migration tests
* Re-enable migration tests
* Apply Ibrahim's suggestion
* Apply Saturn's suggestion
Этот коммит содержится в:
Mario Vitale
2024-09-24 17:50:12 +02:00
коммит произвёл GitHub
родитель 355dd18e52
Коммит 8e2dc45841
2 изменённых файлов: 13 добавлений и 15 удалений

19
.github/workflows/migration.yml поставляемый
Просмотреть файл

@@ -33,17 +33,16 @@ jobs:
docker restart ${COMPOSE_PROJECT_NAME}-mysql-1 && sleep 10
- name: Build test image
env:
BUILD_IMAGE: mattermostdevelopment/mattermost-build-server:${{ steps.go.outputs.GO_VERSION }}
BUILD_IMAGE: golang:${{ steps.go.outputs.GO_VERSION }}-bookworm
PGLOADER_IMAGE: mattermost/mattermost-pgloader:v3.6.9
run: |
echo -e "FROM $BUILD_IMAGE\n\nRUN apt update && \
apt remove -y pgloader && \
apt install -y sbcl unzip libsqlite3-dev make curl gawk freetds-dev libzip-dev && \
git clone https://github.com/dimitri/pgloader.git && \
cd pgloader && \
git checkout \$(git tag --list --sort=-v:refname "v*" | head -n1) && \
make && \
mv build/bin/pgloader /bin" >> dockerfile_tmp
docker build -t $TEST_IMAGE - < dockerfile_tmp
docker build -t $TEST_IMAGE - <<EOF
FROM $PGLOADER_IMAGE AS pgloader
FROM $BUILD_IMAGE
COPY --from=pgloader /usr/bin/pgloader /usr/bin/pgloader
EOF
# Print out installed pgloader version
docker run --rm $TEST_IMAGE pgloader --version
- name: Generate test-data
run: |
docker run --net ${COMPOSE_PROJECT_NAME}_mm-test \

9
.github/workflows/server-ci-template.yml поставляемый
Просмотреть файл

@@ -346,8 +346,7 @@ jobs:
name: server-build-artifact
path: server/build/
retention-days: 2
### Disabled until fixed
#test-migration:
# name: MySQL to PostgreSQL Migration
# uses: ./.github/workflows/migration.yml
# secrets: inherit
test-migration:
name: MySQL to PostgreSQL Migration
uses: ./.github/workflows/migration.yml
secrets: inherit