mskcc / beagle

Voyager Backend
2 stars 5 forks source link

Setup fixtures not working #208

Open stevekm opened 4 years ago

stevekm commented 4 years ago

I tried to set up an instance of the latest develop branch but it failed at this step:

python manage.py loaddata \
file_system.filegroup.json \
file_system.filetype.json \
file_system.storage.json \
runner.pipeline.json

Traceback (most recent call last):
  File "/juno/work/ci/kellys5/projects/beagle-dev/beagle-dev1/conda/lib/python3.7/site-packages/django/db/backends/utils.py", line 82, in _execute
    return self.cursor.execute(sql)
psycopg2.errors.ForeignKeyViolation: insert or update on table "runner_pipeline" violates foreign key constraint "runner_pipeline_operator_id_4c9b7f7a_fk_beagle_etl_operator_id"
DETAIL:  Key (operator_id)=(1) is not present in table "beagle_etl_operator".

Looks like it might need some extra fixtures for setting up dev instances.

stevekm commented 4 years ago

still getting this one on the latest develop branch

stevekm commented 4 years ago

@allanbolipata it looks like maybe its this;

https://github.com/mskcc/beagle/blob/93dd224aa480f297a0d84e1cfc5f84d798ee22a4/runner/fixtures/runner.pipeline.json#L42

https://github.com/mskcc/beagle/blob/93dd224aa480f297a0d84e1cfc5f84d798ee22a4/runner/fixtures/runner.pipeline.json#L71

some of these fixtures have an operator field which is a Foreign Key;

https://github.com/mskcc/beagle/blob/93dd224aa480f297a0d84e1cfc5f84d798ee22a4/runner/models.py#L53

on the Operator model here;

https://github.com/mskcc/beagle/blob/93dd224aa480f297a0d84e1cfc5f84d798ee22a4/beagle_etl/models.py#L49

there are some Operators already in the fixtures;

https://github.com/mskcc/beagle/blob/93dd224aa480f297a0d84e1cfc5f84d798ee22a4/beagle_etl/fixtures/beagle_etl.operator.json

however they will need to be imported first before you can import fixtures from runner.pipeline.json

It looks like the change in https://github.com/mskcc/beagle/pull/274 might be addressing this