Test: 本家に戻ってから再びkmyblueを導入したときのテスト (#474)
* Test: 本家に戻ってから再びkmyblueを導入したときのテスト * Fix test * Fix test * Fix
This commit is contained in:
parent
537f49e816
commit
77843c0bdc
2 changed files with 95 additions and 3 deletions
90
.github/workflows/test-ruby.yml
vendored
90
.github/workflows/test-ruby.yml
vendored
|
@ -348,3 +348,93 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: test-search-screenshots
|
name: test-search-screenshots
|
||||||
path: tmp/screenshots/
|
path: tmp/screenshots/
|
||||||
|
|
||||||
|
test-back-and-return:
|
||||||
|
name: Back to original and return test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:14-alpine
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
options: >-
|
||||||
|
--health-cmd "redis-cli ping"
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
|
env:
|
||||||
|
DB_HOST: localhost
|
||||||
|
DB_USER: postgres
|
||||||
|
DB_PASS: postgres
|
||||||
|
DISABLE_SIMPLECOV: ${{ matrix.ruby-version != '.ruby-version' }}
|
||||||
|
RAILS_ENV: test
|
||||||
|
ALLOW_NOPAM: true
|
||||||
|
PAM_ENABLED: true
|
||||||
|
PAM_DEFAULT_SERVICE: pam_test
|
||||||
|
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
||||||
|
OIDC_ENABLED: true
|
||||||
|
OIDC_SCOPE: read
|
||||||
|
SAML_ENABLED: true
|
||||||
|
CAS_ENABLED: true
|
||||||
|
BUNDLE_WITH: 'pam_authentication test'
|
||||||
|
GITHUB_RSPEC: ${{ matrix.ruby-version == '.ruby-version' && github.event.pull_request && 'true' }}
|
||||||
|
ES_ENABLED: false
|
||||||
|
BACK_UPSTREAM_FORCE: true
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
ruby-version:
|
||||||
|
- '.ruby-version'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
path: './'
|
||||||
|
name: ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Expand archived asset artifacts
|
||||||
|
run: |
|
||||||
|
tar xvzf artifacts.tar.gz
|
||||||
|
|
||||||
|
- name: Set up Ruby environment
|
||||||
|
uses: ./.github/actions/setup-ruby
|
||||||
|
with:
|
||||||
|
ruby-version: ${{ matrix.ruby-version}}
|
||||||
|
additional-system-dependencies: ffmpeg imagemagick libpam-dev
|
||||||
|
|
||||||
|
- name: Load database schema
|
||||||
|
run: './bin/rails db:create db:schema:load db:seed'
|
||||||
|
|
||||||
|
- name: Back to upstream schema
|
||||||
|
run: 'bundle exec rake dangerous:back_upstream'
|
||||||
|
|
||||||
|
- name: Return to kmyblue
|
||||||
|
run: './bin/rails db:migrate'
|
||||||
|
|
||||||
|
- run: bin/rspec
|
||||||
|
|
||||||
|
- name: Upload coverage reports to Codecov
|
||||||
|
if: matrix.ruby-version == '.ruby-version'
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: coverage/lcov/mastodon-back-ret.lcov
|
||||||
|
|
|
@ -7,9 +7,11 @@ namespace :dangerous do
|
||||||
|
|
||||||
prompt = TTY::Prompt.new
|
prompt = TTY::Prompt.new
|
||||||
|
|
||||||
|
unless ENV['BACK_UPSTREAM_FORCE']
|
||||||
exit(0) unless prompt.yes?('[1/3] Do you really want to go back to the original Mastodon?', default: false)
|
exit(0) unless prompt.yes?('[1/3] Do you really want to go back to the original Mastodon?', default: false)
|
||||||
exit(0) unless prompt.yes?('[2/3] All proprietary data of kmyblue will be deleted and cannot be restored. Are you sure?', default: false)
|
exit(0) unless prompt.yes?('[2/3] All proprietary data of kmyblue will be deleted and cannot be restored. Are you sure?', default: false)
|
||||||
exit(0) unless prompt.yes?('[3/3] This operation is irreversible. You have backups in case this operation causes a system malfunction, do you not?', default: false)
|
exit(0) unless prompt.yes?('[3/3] This operation is irreversible. You have backups in case this operation causes a system malfunction, do you not?', default: false)
|
||||||
|
end
|
||||||
|
|
||||||
target_migrations = %w(
|
target_migrations = %w(
|
||||||
20231022074913
|
20231022074913
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue