osuosl / iam

Invoicing and metrics project
Other
4 stars 0 forks source link

Kennric/test data script #254

Closed Kennric closed 7 years ago

Kennric commented 7 years ago

fixes issue #253

Changes in this PR.

Testing this PR.

  1. On staging: rvm all do rake export_data
  2. Examine the generated data to make sure it is anonymized
  3. Copy data to local instance (or copy from fir:/tmp/test_data)
  4. docker-compose run dev bash
  5. rake import_data
  6. exit and docker-compose up dev
  7. visit localhost:4567 and view your data in the app

@osuosl/devs

@alxngyn @hsolorza @ramereth

ramereth commented 7 years ago

@Kennric you should automatically create the test_data directory, otherwise it errors out.

Kennric commented 7 years ago

@alxngyn the database wiping is a documentation issue - we need to document that dev instances should use a separate db file from the test instance.

ramereth commented 7 years ago

@Kennric remind me the steps I need to do to properly import the data into a docker-compose instance? I'm having a hard time getting the data to show up after I load it and run dev up. If you could provide step by step that would be great.

Thanks-

Kennric commented 7 years ago

@ramereth

To import data in the docker dev instance

Assuming you have data exported as described in docs/source/development/test_data.rst in a directory test_data in the app directory:

  1. in dockerfiles/app.env change the database url to prevent tests from overwriting the dev database - default is test.sqlite, just change it to something else
DB_URL=sqlite://dev.sqlite
  1. docker-compose run dev bash
  2. rake import_data
  3. Answer when it asks if you are sure
  4. exit
  5. docker-compose up dev
  6. visit http://localhost:4567
ramereth commented 7 years ago

@Kennric I'm getting the following error on step 2. Did you miss a step I needed to do?

Sequel::DatabaseError: SQLite3::SQLException: no such table: plugins