Add AWS key for S3 capybara uploads during test failures (#9096)

* Add AWS key for docker-compose.ci

* Break test on purpose

* small fix

* Fix bucket name

* Remove test failure

Co-authored-by: Cyril Rohr <cyril.rohr@gmail.com>
pull/9099/head
Oliver Günther 4 years ago committed by GitHub
parent ddc7cb3d71
commit 4e16b3452c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      .github/workflows/test-core.yml
  2. 2
      docker-compose.ci.yml
  3. 10
      spec/support/capybara.rb

@ -61,11 +61,8 @@ jobs:
CI_CACHE_PATH: "/tmp/cache"
LOCAL_DEV_CHECK: 1
CI_RETRY_COUNT: 3
OPENPROJECT_ENABLE_CAPYBARA_SCREENSHOT_S3_UPLOADS: true
AWS_ACCESS_KEY_ID: "${{ secrets.CAPYBARA_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.CAPYBARA_AWS_SECRET_ACCESS_KEY }}"
AWS_REGION: "eu-west-1"
S3_BUCKET_NAME: "openproject-ci-public-logs"
CAPYBARA_AWS_ACCESS_KEY_ID: "${{ secrets.CAPYBARA_AWS_ACCESS_KEY_ID }}"
CAPYBARA_AWS_SECRET_ACCESS_KEY: "${{ secrets.CAPYBARA_AWS_SECRET_ACCESS_KEY }}"
steps:
- uses: actions/checkout@v2
- name: cache

@ -11,6 +11,8 @@ services:
environment:
RSPEC_RETRY_RETRY_COUNT: "${CI_RETRY_COUNT:-3}"
JOBS: "${CI_JOBS:-8}"
CAPYBARA_AWS_ACCESS_KEY_ID: "${CAPYBARA_AWS_ACCESS_KEY_ID}"
CAPYBARA_AWS_SECRET_ACCESS_KEY: "${CAPYBARA_AWS_SECRET_ACCESS_KEY}"
tmpfs:
- "/tmp"
volumes:

@ -35,14 +35,14 @@ Capybara::Screenshot.prune_strategy = :keep_last_run
Capybara.server = :puma, { Silent: false }
# Set up S3 uploads if desired
if ENV['OPENPROJECT_ENABLE_CAPYBARA_SCREENSHOT_S3_UPLOADS'] && ENV['AWS_ACCESS_KEY_ID']
if ENV['CAPYBARA_AWS_ACCESS_KEY_ID']
Capybara::Screenshot.s3_configuration = {
s3_client_credentials: {
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('AWS_ACCESS_KEY_SECRET'),
region: ENV.fetch('AWS_REGION', 'eu-west-1')
access_key_id: ENV.fetch('CAPYBARA_AWS_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('CAPYBARA_AWS_SECRET_ACCESS_KEY'),
region: ENV.fetch('CAPYBARA_AWS_REGION', 'eu-west-1')
},
bucket_name: ENV.fetch('S3_BUCKET_NAME', 'openproject-travis-logs')
bucket_name: ENV.fetch('CAPYBARA_AWS_BUCKET', 'openproject-ci-public-logs')
}
end

Loading…
Cancel
Save