2017年5月25日木曜日

RedmineのテストFixturesを手動テスト用に投入する

RedmineのテストFixturesを手動テスト用に投入するのに以下のようなスクリプトを作成しました。
https://github.com/jbbarth/redmine-scripts
を参考にしました。

#!/bin/bash
export RAILS_ENV=test
test -e test/.fixtures.core || cp -a test/fixtures test/.fixtures.core
rm -rf test/fixtures
mkdir test/fixtures
cp -i test/.fixtures.core/*yml test/fixtures/
cp -i plugins/*/test/fixtures/*yml test/fixtures/
cp -i plugins/*/spec/fixtures/*yml test/fixtures/
bundle exec rake db:drop db:create db:migrate redmine:plugins db:schema:dump db:fixtures:load
cp -f db/test.sqlite3 db/test.template.sqlite3

上記を実行してから、
$ RAILS_ENV=test ruby bin/rails server
で起動すると、Fixturesに含まれているeCookbookなどのプロジェクトが使えます。

0 件のコメント:

コメントを投稿

RedmineプラグインをGitHub Actionsでテストする

Redmine Advent Calendar 2019 の Qiita で書きました。追っかけで もう一つ 。 Travis-CIで行っていたRedmineプラグインのCIを、GitHub Actionsに変更したものです。 GitHub Actionsをやってみようという...