Skip to content

Conversation

@vdonato
Copy link
Collaborator

@vdonato vdonato commented Apr 29, 2021

This should make it possible to generate and update snapshots without relying
on CI in some way (either by deleting snapshots to have CI regenerate them or
having CI generate diffs to be processed by the cropping script)

After this PR goes in, I'll spend some time reworking our wiki pages to include
instructions on how to use this image as well as an overview of all of the
available options for updating snapshots.

Unfortunately, this isn't a perfect cure for our snapshot woes for a few
reasons.

  • it takes forever to build image, mostly due to the length of time it
    takes to install Python dependencies. As far as I can tell, this is
    naturally quite slow, and there's not much we can do about it.
  • for whatever reason I'm having trouble getting component-template
    tests to work, but this is just a minor annoyance for now as those
    don't change much. This does mean that you can't run all e2e tests
    easily since they'll fail midway through due to these tests blowing
    up, but doing this takes so long that it seems unlikely that it'll be
    done often anyway.

Closes #2682

@vdonato vdonato marked this pull request as ready for review April 29, 2021 23:09
@vdonato vdonato requested a review from a team April 29, 2021 23:09
@vdonato vdonato force-pushed the revive-snapshot-image branch 2 times, most recently from d1bd50a to bbafe93 Compare April 29, 2021 23:16
This should make it possible to generate and update snapshots without relying
on CI in some way (either by deleting snapshots to have CI regenerate them or
having CI generate diffs to be processed by the cropping script)

After this PR goes in, I'll spend some time reworking our wiki pages to include
instructions on how to use this image as well as an overview of all of the
available options for updating snapshots.

Unfortunately, this isn't a perfect cure for our snapshot woes for a few
reasons.

* it takes *forever* to build image, mostly due to the length of time it
  takes to install Python dependencies. As far as I can tell, this is
  naturally quite slow, and there's not much we can do about it.
* for whatever reason I'm having trouble getting component-template
  tests to work, but this is just a minor annoyance for now as those
  don't change much. This does mean that you can't run all e2e tests
  easily since they'll fail midway through due to these tests blowing
  up, but doing this takes so long that it seems unlikely that it'll be
  done often anyway.
@vdonato vdonato force-pushed the revive-snapshot-image branch from bbafe93 to 77d711f Compare April 30, 2021 00:10
image: streamlit_circleci
build: .
ports:
- "3000:3000"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this port mapping is redundant in the previous version?

Copy link
Collaborator Author

@vdonato vdonato May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port mapping here was actually used to expose port 3000 of the docker container to the local machine, and I decided that it's most likely annoying to have to stop the local dev server that people normally have already-running on port 3000 when taking snapshots

I think ideally, we would want the docker container to be able to access the host machine's react dev server (it currently has to spin up its own when running tests), but that ends up being annoying to get working in both MacOS and Linux because

  • you can only use localhost in the container to access the host machine in Linux and not MacOS
  • on MacOS, you can access the special DNS name host.docker.internal within a container to talk to the host, but this DNS name doesn't work on Linux without passing some additional flags
  • we would have to change all of our e2e tests to use either localhost or host.docker.internal depending on the environment the test is being run in

This might be something we want to smooth out later when there's time to do so, but for now totally isolating the container's dev server seems okay to me

@vdonato vdonato merged commit da5a0ba into streamlit:develop May 5, 2021
@vdonato vdonato deleted the revive-snapshot-image branch May 5, 2021 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix e2e/Dockerfile to properly replicate the CI env for cypress tests

2 participants