Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Failing migration doesn't cause CI to fail #2291

Open
erezmus opened this issue Jul 11, 2019 · 4 comments
Open

Failing migration doesn't cause CI to fail #2291

erezmus opened this issue Jul 11, 2019 · 4 comments
Labels
Bug Anything that does not work as expected. Testing Anything related to testing.

Comments

@erezmus
Copy link
Contributor

erezmus commented Jul 11, 2019

The migration for #2275 had a syntax error but it didn't cause the CI to go red.

from pipeline.log

error: Error while running migrations: CREATE TABLE survey_response (
[2019-07-11T10:07:31.978Z]   response_id UUID PRIMARY KEY,
[2019-07-11T10:07:31.978Z]   submission_id UUID NOT NULL,
[2019-07-11T10:07:31.978Z]   response JSONB NOT NULL,
[2019-07-11T10:07:31.978Z]   created TIMESTAMP WITH TIMEZONE NOT NULL DEFAULT current_timestamp; 
[2019-07-11T10:07:31.978Z] );
[2019-07-11T10:07:31.978Z]  - syntax error at or near "WITH" error: syntax error at or near "WITH"
[2019-07-11T10:07:31.978Z]     at Function.raw (/home/xpub/node_modules/pubsweet/node_modules/knex/lib/util/make-knex.js:48:30)
[2019-07-11T10:07:31.978Z]     at Object.up (/home/xpub/node_modules/pubsweet/node_modules/@pubsweet/db-manager/src/helpers/umzug.js:13:15)
[2019-07-11T10:07:31.978Z]     at <anonymous>
@erezmus erezmus added Bug Anything that does not work as expected. Testing Anything related to testing. labels Jul 11, 2019
@erezmus
Copy link
Contributor Author

erezmus commented Jul 11, 2019

/cc @giorgiosironi

@giorgiosironi
Copy link
Contributor

The pull request is #2289
The build that should have failed is: https://alfred.elifesciences.org/blue/organizations/jenkins/pull-requests-projects%2Felife-xpub/detail/PR-2289/1/pipeline/39
I imagine

IMAGE_TAG=5b231c2da82945db74de6d7c37cb9ebb734b58c2 NODE_ENV=production NODE_CONFIG_ENV=unit-test docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --name elife-xpub_app_test app npx pubsweet migrate

is returning a 0 exit code, will try to reproduce.

@giorgiosironi
Copy link
Contributor

Confirmed:

$ NODE_ENV=production NODE_CONFIG_ENV=unit-test docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --name elife-xpub_app_test app npx pubsweet migrate
Starting elife-xpub_sftp_1      ... done
Starting elife-xpub_fakes3_1    ... done
Starting elife-xpub_postgres_1  ... done
error: Error while running migrations: CREATE TABLE survey_response (
  response_id UUID PRIMARY KEY,
  submission_id UUID NOT NULL,
  response JSONB NOT NULL,
  created TIMESTAMP WITH TIMEZONE NOT NULL DEFAULT current_timestamp; 
);
 - syntax error at or near "WITH" error: syntax error at or near "WITH"
    at Function.raw (/home/xpub/node_modules/pubsweet/node_modules/knex/lib/util/make-knex.js:48:30)
    at Object.up (/home/xpub/node_modules/pubsweet/node_modules/@pubsweet/db-manager/src/helpers/umzug.js:13:15)
    at <anonymous>
[09:39:35][giorgio@Newton:~/code/elife-xpub]$ echo $?
0

Problem is inside npx pubsweet migrate.

@diversemix
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Anything that does not work as expected. Testing Anything related to testing.
Projects
None yet
Development

No branches or pull requests

3 participants