Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

134 test migrations #1247

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
34 changes: 33 additions & 1 deletion ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,19 @@ timeout(time: 2, unit: 'HOURS') {
'schema': runDockerPostgresSidecar(
'echo schema test', schemaStashsrc, schemaStashdir
),
'migration': runDockerPostgresSidecar(testMigrations()),

'migration': runDockerPostgresSidecar(
'make migration',
['backend/src/schema.rs'],
['schemaold.rs']
),

'redomigration': runDockerPostgresSidecar(
testMigrations(),
['backend/src/schema.rs'],
['schemanew.rs']
),

'changelog': runDocker(
'./ci/scripts/check-changelog.sh',
'permaplant-node:ci',
Expand All @@ -265,6 +277,18 @@ timeout(time: 2, unit: 'HOURS') {
),
failFast: true
)

node('docker') {
unstash('schemaold.rs')
def beforeChecksum = sh(script: "sha256sum backend/src/schema.rs", returnStdout: true).trim()
unstash('schemanew.rs')
def afterChecksum = sh(script: "sha256sum backend/src/schema.rs", returnStdout: true).trim()
if (beforeChecksum != afterChecksum) {
throw new SchemaModifiedException()
} else {
echo 'Schema.rs was not modified during migration tests.'
}
}
lukashartl marked this conversation as resolved.
Show resolved Hide resolved
}

stage('Test and Build') {
Expand Down Expand Up @@ -440,3 +464,11 @@ class UnequalStashException extends Exception {
}

}

class SchemaModifiedException extends Exception {

SchemaModifiedException() {
super('Schema.rs was modified during migration tests.')
}

}
1 change: 1 addition & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Syntax: `- short text describing the change _(Your Name)_`
- wrap api queries using react query _(Daniel Steinkogler)_
- CI: running pr deployment only on pr and not master branch _(Filip Markovic)_
- CI: unstash schemas in release pipeline in build-backend _(4ydan)_
- CI: added check if schema.rs changes in remigration _(Filip Markovic)_
- _()_
- Fixed German common names not being used when language is set to German _(Christoph Schreiner)_
- _()_
Expand Down