Merge pull request #345 from openHPI/enhance_provision_instructions

Improve provision instructions
This commit is contained in:
MrSerth
2019-10-23 08:25:28 -04:00
committed by GitHub
3 changed files with 20 additions and 1 deletions

View File

@ -25,6 +25,7 @@ In order to execute code submissions using Docker, source code files are written
- create *config/sendmail.yml* - create *config/sendmail.yml*
- create *config/smtp.yml* - create *config/smtp.yml*
- use boot2docker or vagrant if there is no native support for docker on your OS - use boot2docker or vagrant if there is no native support for docker on your OS
- if you want to use the app without docker (and hence without code execution) comment the validation `validate :working_docker_image?` in `models/execution_environments.rb` otherwise the seed will fail (because of missing docker connection)
- create seed data by executing `rake db:seed` - create seed data by executing `rake db:seed`
- if you already created a configuration for your local installation and want to use vagrant, too, be sure to log into the vagrant instance via ssh and add your database user manually to the database. Afterwards, create, migrate and seed. - if you already created a configuration for your local installation and want to use vagrant, too, be sure to log into the vagrant instance via ssh and add your database user manually to the database. Afterwards, create, migrate and seed.

View File

@ -18,7 +18,7 @@ end
# delete all present records # delete all present records
Rails.application.eager_load! Rails.application.eager_load!
(ApplicationRecord.descendants - [ActiveRecord::SchemaMigration]).each(&:delete_all) (ApplicationRecord.descendants - [ActiveRecord::SchemaMigration, User]).each(&:delete_all)
# delete file uploads # delete file uploads
FileUtils.rm_rf(Rails.root.join('public', 'uploads')) FileUtils.rm_rf(Rails.root.join('public', 'uploads'))

18
spec/db/seeds_spec.rb Normal file
View File

@ -0,0 +1,18 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'seeds' do
subject(:seed) { Rake::Task['db:seed'].invoke }
before do
CodeOcean::Application.load_tasks
allow(Rails).to receive(:env) { 'development'.inquiry }
end
describe 'execute db:seed' do
it 'collects the test results' do
expect { seed }.not_to raise_error(StandardError)
end
end
end