Page MenuHomePhabricator

Mock more of the GraphQL queries, add snapshot test for new runs page

Authored by bengotow on Sep 5 2019, 3:24 PM.


Group Reviewers
Restricted Project

This diff adds a snapshot test for the new runs page. In order to show an
actual run on the page, the script to generate mock data now kicks off a log_spew
before using dagster-graphql to query data.

I'm not super happy with how this snapshot testing stuff is working - I tried for
a while to add a test of the run details page, but generation of the mock data is
complicated because the run gets a random ID and all the timestamps cause the
snapshot to break whenever the mock data is rebuilt. Apollo was also throwing
cryptic errors I think are related to mocking the streaming logs query.

Long story short I think we'll need to move to slightly more granular tests for
the run details page. Will take another pass at this soon.

Test Plan

Run new tests

Diff Detail

R1 dagster
Lint OK
No Unit Test Coverage

Event Timeline

bengotow created this revision.Sep 5 2019, 3:24 PM
alangenfeld requested changes to this revision.Sep 6 2019, 6:00 PM
alangenfeld added a subscriber: alangenfeld.

the script to generate mock data now kicks off a log_spew before using dagster-graphql to query data

ehh im not a fan of this - i think i would prefer a more holistic mocking solution to tackle this and the details page then this approach

This revision now requires changes to proceed.Sep 6 2019, 6:00 PM
bengotow abandoned this revision.Sep 13 2019, 3:46 AM

Sounds good! I think this snapshot testing isn't working out very well because the mock data for Dagit is very hard to generate / very large compared to your typical react application, and is still changing often enough that we need to be able to re-generate it or it'll fall out of sync with the actual runtime values pretty quickly. I'm going to abandon this and I'll see if we can start writing more component-level / panel-level tests that might require less sophisticated / more piece-meal mock data.