|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | 3 | FactoryBot.define do |
| 4 | + factory :coffee_script, class: 'ExecutionEnvironment' do |
| 5 | + created_by_teacher |
| 6 | + default_memory_limit |
| 7 | + default_cpu_limit |
| 8 | + docker_image { 'hklement/ubuntu-coffee:latest' } |
| 9 | + file_type { association :dot_coffee, user: } |
| 10 | + help |
| 11 | + name { 'CoffeeScript' } |
| 12 | + network_enabled { false } |
| 13 | + privileged_execution { false } |
| 14 | + permitted_execution_time { 10.seconds } |
| 15 | + pool_size { 0 } |
| 16 | + run_command { 'coffee' } |
| 17 | + singleton_execution_environment |
| 18 | + end |
| 19 | + |
4 | 20 | factory :html, class: 'ExecutionEnvironment' do |
5 | 21 | created_by_teacher |
6 | 22 | default_memory_limit |
7 | 23 | default_cpu_limit |
8 | | - docker_image { 'openhpi/co_execenv_ruby:latest' } |
| 24 | + docker_image { 'hklement/ubuntu-html:latest' } |
9 | 25 | file_type { association :dot_html, user: } |
10 | 26 | help |
11 | 27 | name { 'HTML5' } |
|
37 | 53 | testing_framework { 'JunitAdapter' } |
38 | 54 | end |
39 | 55 |
|
| 56 | + factory :jruby, class: 'ExecutionEnvironment' do |
| 57 | + created_by_teacher |
| 58 | + default_memory_limit |
| 59 | + default_cpu_limit |
| 60 | + docker_image { 'hklement/ubuntu-jruby:latest' } |
| 61 | + file_type { association :dot_rb, user: } |
| 62 | + help |
| 63 | + name { 'JRuby 1.7' } |
| 64 | + network_enabled { false } |
| 65 | + privileged_execution { false } |
| 66 | + permitted_execution_time { 10.seconds } |
| 67 | + pool_size { 0 } |
| 68 | + run_command { 'jruby %{filename}' } |
| 69 | + singleton_execution_environment |
| 70 | + test_command { 'rspec %{filename} --format documentation' } |
| 71 | + testing_framework { 'RspecAdapter' } |
| 72 | + end |
| 73 | + |
40 | 74 | factory :node_js, class: 'ExecutionEnvironment' do |
41 | 75 | created_by_teacher |
42 | 76 | default_memory_limit |
43 | 77 | default_cpu_limit |
44 | | - docker_image { 'openhpi/co_execenv_node:latest' } |
| 78 | + docker_image { 'hklement/ubuntu-node:latest' } |
45 | 79 | file_type { association :dot_js, user: } |
46 | 80 | help |
47 | 81 | name { 'Node.js' } |
|
75 | 109 | created_by_teacher |
76 | 110 | default_memory_limit |
77 | 111 | default_cpu_limit |
78 | | - docker_image { 'openhpi/co_execenv_ruby:latest' } |
| 112 | + docker_image { 'hklement/ubuntu-ruby:latest' } |
79 | 113 | file_type { association :dot_rb, user: } |
80 | 114 | help |
81 | 115 | name { 'Ruby 2.2' } |
|
89 | 123 | testing_framework { 'RspecAdapter' } |
90 | 124 | end |
91 | 125 |
|
| 126 | + factory :sinatra, class: 'ExecutionEnvironment' do |
| 127 | + created_by_teacher |
| 128 | + default_memory_limit |
| 129 | + default_cpu_limit |
| 130 | + docker_image { 'hklement/ubuntu-sinatra:latest' } |
| 131 | + file_type { association :dot_rb, user: } |
| 132 | + exposed_ports { [4567] } |
| 133 | + help |
| 134 | + name { 'Sinatra' } |
| 135 | + network_enabled { true } |
| 136 | + privileged_execution { false } |
| 137 | + permitted_execution_time { 15.minutes } |
| 138 | + pool_size { 0 } |
| 139 | + run_command { 'ruby %{filename}' } |
| 140 | + singleton_execution_environment |
| 141 | + test_command { 'rspec %{filename} --format documentation' } |
| 142 | + testing_framework { 'RspecAdapter' } |
| 143 | + end |
| 144 | + |
| 145 | + factory :sqlite, class: 'ExecutionEnvironment' do |
| 146 | + created_by_teacher |
| 147 | + default_memory_limit |
| 148 | + default_cpu_limit |
| 149 | + docker_image { 'hklement/ubuntu-sqlite:latest' } |
| 150 | + file_type { association :dot_sql, user: } |
| 151 | + help |
| 152 | + name { 'SQLite' } |
| 153 | + network_enabled { false } |
| 154 | + privileged_execution { false } |
| 155 | + permitted_execution_time { 1.minute } |
| 156 | + pool_size { 0 } |
| 157 | + run_command { 'sqlite3 /database.db -init %{filename} -html' } |
| 158 | + singleton_execution_environment |
| 159 | + test_command { 'ruby %{filename}' } |
| 160 | + testing_framework { 'SqlResultSetComparatorAdapter' } |
| 161 | + end |
| 162 | + |
92 | 163 | trait :default_memory_limit do |
93 | 164 | memory_limit { ExecutionEnvironment::DEFAULT_MEMORY_LIMIT } |
94 | 165 | end |
|
0 commit comments