Closed Bug 1133273 Opened 9 years ago Closed 9 years ago

Treeherder tests use treeherder database instead of test_treeherder database after Django 1.7 changes

Categories

(Tree Management :: Treeherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1193836

People

(Reporter: jlal, Unassigned)

References

Details

Attachments

(1 file)

While writing some new tests I could not figure out why the record I was creating was throwing integrity errors it turned out the test database was not being used (or purged) between test runs (perhaps this is intentional?)

Ideally we use the test_treeherder database for tests and drop data on error (I think this was the previous behavior prior to updating django)
Priority: -- → P1
Assignee: nobody → cdawson
Priority: P1 → P2
I'm not going to get to this before my PTO
Assignee: cdawson → nobody
OS: Mac OS X → All
Hardware: x86 → All
Summary: Treeherder tests use treeherder database instead of test_treeherder database. → Treeherder tests use treeherder database instead of test_treeherder database after Django 1.7 changes
Did you get a chance to look at this? (regression from bug 1119479) I'm happy to take it on, just don't want to repeat work if you have a WIP locally :-)
Flags: needinfo?(cdawson)
Ed--  Hey there.  I did not get a chance, no.  If you want to take it, that'd be awesome.  Thanks man!
Flags: needinfo?(cdawson)
Cool - no problem! :-)
Assignee: nobody → emorley
Assignee: emorley → nobody
(In reply to Ed Morley (UK public holiday 31st Aug) [:emorley] from comment #1)
> The Django 1.7 PR included this removal:
> https://github.com/mozilla/treeherder-service/commit/
> 698fd0551907d7c8c29514d9a897718e06b23e28#diff-
> 484462fced51d1a06b1d93b4a44dd535L58

You might think that just reverting those lines would fix the problem, but I'm afraid it doesn't (see the attached error output). Unfortunately we don't know exactly what's failing because it throws an exception when tearing down the test environment. Oh well.

I suspect our problems probably come from the fact that we call various external commands in the unit tests to initialize the external datasource databases, but these commands aren't inheriting our test settings. I dunno, I could be wrong.

Fixing this bug feels hard, at least to me. Part of me thinks we'd be best off just exorcising datasource and deleting most of conftest.py once everything's in a single database, instead of trying to keep a collection of what are essentially hacks working.
This was fixed in bug 1193836.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Component: Treeherder: Docs & Development → TreeHerder
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: