Coder Social home page Coder Social logo

Integration with testing about goose HOT 2 CLOSED

yoesoff avatar yoesoff commented on May 22, 2024
Integration with testing

from goose.

Comments (2)

VojtechVitek avatar VojtechVitek commented on May 22, 2024 2

Hey there,
I do the following in our CI tests:

Given I have

  • schema.sql file with latest DB schema
  • and schema-pre-migration.sql file matching the DB schema state before the first available migration is run (this is how we clean-up old migrations)

DB schema + Goose migration test:

  1. DROP database_goose
  2. CREATE database_goose
  3. psql database_goose < schema-pre-migration.sql
  4. goose up
  5. goose reset
  6. goose up
  7. pg_dump database_goose --schema-only | grep -v -e '^--' -e '^COMMENT ON' -e '^REVOKE' -e '^GRANT' -e '^SET' -e 'ALTER DEFAULT PRIVILEGES' -e 'OWNER TO' | cat -s > schema.sql
  8. git diff the schema.sql against "latest" schema.sql that is checked-into our git codebase and error out if it differs

Application tests:

  1. DROP database_app
  2. CREATE database_app
  3. psql database_app < schema.sql
  4. Run application tests against latest schema only

from goose.

yoesoff avatar yoesoff commented on May 22, 2024

solved by removing "\ from command arguments

from goose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.