Search code examples
kubernetesselenium-webdrivercontinuous-integrationwebdriverdrone.io

Selenium + Drone - How to download a file into one of multiple volumes on CI?


I have an automated test suite that splits into 7 jobs when running on CI. I'm trying to add tests to it to download a file and check its contents, and I was able to do it by setting up the volume:

  volumes:
  ...
  - name: downloads
    path: /drone/src/.../download_folder

within all e2e_tests jobs, and the volume:

volumes:
  ...
  - name: downloads
    path: /tmp/downloads

within each chrome job. However, this only works when running the "download" tests in isolation, and not with all other tests running in parallel.

To solve this, I set up one downloads-{index} volume for each job, so it would look like:

  volumes:
  ...
  - name: downloads-1
    path: /drone/src/.../download_folder_1

for e2e_tests_1, and

volumes:
  ...
  - name: downloads-1
    path: /tmp/downloads-1

for chrome-1 (the runner for that same job).

I thought this would work, but the files are no longer being downloaded to the corresponding folders (even when running the tests in isolation). Does anyone know why this might be happening? Thank you so much in advance.


Solution

  • Solved, in case anyone is stuck with a similar issue: the chrome runners in CI didn't correspond 1-1 with an e2e_test job. So for example e2e_test_2 could be executed by chrome-2 (in which case the file would go to the corresponding volume and the test would find it and pass) or by chrome-4 (in which it wouldn't). Solutions for this will depend on how concurrency is managed, but ultimately it's not an issue with drone itself.