Skip to content

Automated builds in the test environment make E2E testing very heavy #291

Closed

Description

@cc-kawakami

Is your feature request related to a problem? Please describe.
I occasionally use Capybara to write E2E tests and was concerned that the tests were very slow. As a result, it took me a little while to realize that it was due to the fact that vite_rails is configured to autoBuild in the test environment.

Describe the solution you'd like
Shouldn't the default config file turn off autoBuild in the test environment, since the source should not be changed during testing?

"test": {
"autoBuild": true,
"publicOutputDir": "vite-test",
"port": 3037
}

Activity

  1. changed the title [-]Automated builds in the test environment make end-to-end testing very heavy[/-] [+]Automated builds in the test environment make E2E testing very heavy[/+] on Oct 29, 2022
  2. ElMassimo commented on Oct 31, 2022

    @ElMassimo
    Owner

    Hi Moeki!

    You can run assets:precompile or vite:build in the CI once before running integration tests, as it will make it clearer how much time is being spent in assets vs tests. vite:build will detect that assets are up-to-date, skipping the build during tests.

    However, autoBuild: true is still a good default for the test environment, as it allows users to avoid building assets manually when running tests locally, and in small apps provides a simpler CI setup.

  3. cc-kawakami commented on Oct 31, 2022

    @cc-kawakami
    Author

    I understand. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions