Skip to content

Commit

Permalink
download testing work with a separated volume
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhoubk committed Jan 28, 2025
1 parent 1a2d1f7 commit 7cc2657
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ RUN groupadd --system --gid $APP_UID $APP_USER \
RUN mkdir -p /opt/app \
&& chown -R $APP_USER:$APP_USER /opt/app /usr/local/bundle

RUN mkdir -p /opt/app/tmp/selenium_downloads
# RUN mkdir -p /opt/app/tmp/selenium_downloads
# RUN mkdir -p /opt/app/artifacts

# RUN mkdir -p /opt/app/artifacts/Downloads \
# && chown 1200:1201 /opt/app/artifacts/Downloads

# RUN mkdir -p /opt/app/artifacts \
# && chown 1200:1201 /opt/app/artifacts

RUN mkdir -p /home/seluser/Downloads \
&& chown 1200:1201 /home/seluser/Downloads

# Get list of available packages
RUN apt-get update -qq
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ services:
- selenium.test
shm_size: 2g
volumes:
- ./tmp/selenium_downloads:/home/seluser/Downloads
- artifacts:/opt/app/artifacts
# - ./tmp/selenium_downloads:/home/seluser/Downloads

volumes:
artifacts:
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:
- SOLR_URL=http://solr:8983/solr/geodata-test
volumes:
- ./:/opt/app:delegated
- downloads:/home/seluser/Downloads
# - artifacts:/opt/app/artifacts

db:
image: postgres:16.4
Expand Down Expand Up @@ -50,4 +52,9 @@ services:
- selenium.test
shm_size: 2g
volumes:
- ./tmp/selenium_downloads:/home/seluser/Downloads
- downloads:/home/seluser/Downloads
# - ./tmp/selenium_downloads:/home/seluser/Downloads

volumes:
artifacts:
downloads:
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
]

chrome_options = Selenium::WebDriver::Chrome::Options.new(args: chrome_args).tap do |options|
options.add_preference(:download, prompt_for_download: false, directory_upgrade: true)
options.add_preference(:download, prompt_for_download: false, directory_upgrade: true, default_directory: '/home/seluser/Downloads')
options.add_preference(:browser, set_download_behavior: { behavior: 'allow' })
end

Expand Down
3 changes: 2 additions & 1 deletion spec/support/constants/test_constants.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module CommonHelpers
EXPORT_TMP_PATH = '/opt/app/tmp/cache/downloads'.freeze
DOWNLOAD_TMP_PATH = '/opt/app/tmp/selenium_downloads'.freeze
# DOWNLOAD_TMP_PATH = '/opt/app/tmp/selenium_downloads'.freeze
DOWNLOAD_TMP_PATH = '/home/seluser/Downloads'.freeze
PUBLIC_RECORD_ID = 'berkeley-s7038h'.freeze
RESTRICTED_RECORD_ID = 'berkeley-s7b12n'.freeze
end

0 comments on commit 7cc2657

Please sign in to comment.