manager icon indicating copy to clipboard operation
manager copied to clipboard

M3-5809: Run Cypress via Docker Compose

Open jdamore-linode opened this issue 3 years ago • 4 comments

Description

What does this PR do? This PR adds the capability to run Cypress via Docker, which will later be used to run Cypress in Jenkins.

Because this was built with Jenkins in mind, it is assumed that dependencies are already installed (for Linux systems) and that Cloud Manager is already built when the Docker container starts.

How to test

What are the steps to reproduce the issue or verify the changes?

Before you can build and start the containers, you must install Node dependencies for Linux and build Cloud Manager. Because Docker volumes run slowly on MacOS, this will take noticeably longer than usual but thankfully only needs to be done once. Install Linux dependencies and build Cloud Manager using these commands:

# From `manager` repo root
# Run `yarn clean` to delete Node dependencies for MacOS
yarn clean

# Run `yarn install:all` from inside the web container to install Node dependencies for Linux
docker compose run web yarn install:all

# Run `yarn build` from inside the web container to build Cloud Manager using Linux dependencies
docker compose run web yarn build

Running the 3 commands above took 25 minutes on my machine.

Once your environment is set up, you can run Cypress via Docker Compose:

docker compose build
docker compose up e2e

Confirm that Cypress runs and that tests are generally passing.

jdamore-linode avatar Jul 28 '22 14:07 jdamore-linode

Do these changes assume Cloud Manager is fully built and ready to be served from packages/manager/build? I assume this will happen in another CI step?

bnussman avatar Jul 28 '22 15:07 bnussman

@bnussman That's correct! The Jenkins build script will be responsible for installing dependencies and building Cloud Manager. It's WIP, but there's a link to the corresponding Jenkinsfile changes in the comments of M3-5895 if you want to see how the two pieces fit together.

jdamore-linode avatar Jul 28 '22 16:07 jdamore-linode

Everything built and the tests ran and they passed! I didn't let the entire suite run, but it looked good when it was running. Will this new approach allow us to still do parallelization with more than one instance?

Thanks! No need to let the tests finish. As of now there's no parallelization, but this ticket lays some groundwork for that and another ticket (M3-5896) details the remaining work that needs to be done to get parallelization working (which really isn't very much).

jdamore-linode avatar Aug 05 '22 18:08 jdamore-linode

@patthiel Managed to narrow down the scope of our volumes a little bit -- I was pretty limited by what I could do for the e2e container sadly. Let me know if you have any other suggestions!

jdamore-linode avatar Aug 08 '22 15:08 jdamore-linode