mumuki-gobstones-runner 1.10.2 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets_server.rb +6 -5
- data/lib/checker.rb +9 -5
- data/lib/gobstones_runner.rb +1 -1
- data/lib/precompile_hook.rb +5 -1
- data/lib/public/black.svg +3638 -0
- data/lib/public/blue.svg +3638 -0
- data/lib/public/green.svg +3639 -0
- data/lib/public/red.svg +3638 -0
- data/lib/render/editor/editor.css +36 -0
- data/lib/render/editor/editor.html +2 -1
- data/lib/version_hook.rb +1 -1
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3199fbffe852edccab69f24303b07c4d177902f5fbcc60e8440c88dbd8f7b25c
|
4
|
+
data.tar.gz: c105259943ecac7f90d24a1a7e4dc775546247b795bafc68fd5f64934b6e39e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7005215585bd9fbc9427edc5b4e24ae7164e8e42a45d8b260324f047bf0871e7c8f047cd3c0aaeb64414d515ac75c535bd6a1aad4ec1257958f60a112db74673
|
7
|
+
data.tar.gz: d7b6921fdbbb445704febd35d6711dbd900cecc4ed7d2d6c03e05feca5bb9e1ef4ed0a9fe8e0877b2210b3b1a0448512bba29cf849d3058a6dbbdd4b8c6124a6
|
data/lib/assets_server.rb
CHANGED
@@ -31,9 +31,9 @@ class Mumukit::Server::App < Sinatra::Base
|
|
31
31
|
get_asset route, File.join(__dir__, '..', path), type
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
['polymer', 'polymer-mini', 'polymer-micro'].each { |name|
|
35
|
+
get_board_asset "#{name}.html", "htmls/vendor/#{name}.html", 'text/html'
|
36
|
+
}
|
37
37
|
get_board_asset 'gs-board.html', 'htmls/gs-board.html', 'text/html'
|
38
38
|
|
39
39
|
get_editor_asset 'editor/gs-element-blockly.html', 'htmls/gs-element-blockly.html', 'text/html'
|
@@ -44,6 +44,7 @@ class Mumukit::Server::App < Sinatra::Base
|
|
44
44
|
get_local_asset 'editor/editor.css', 'lib/render/editor/editor.css', 'text/css'
|
45
45
|
get_local_asset 'editor/editor.html', 'lib/render/editor/editor.html', 'text/html'
|
46
46
|
get_local_asset 'boom.png', 'lib/public/boom.png', 'image/png'
|
47
|
-
|
48
|
-
|
47
|
+
['red', 'blue', 'green', 'black', 'attires_enabled', 'attires_disabled'].each { |name|
|
48
|
+
get_local_asset "editor/#{name}.svg", "lib/public/#{name}.svg", 'image/svg+xml'
|
49
|
+
}
|
49
50
|
end
|
data/lib/checker.rb
CHANGED
@@ -10,11 +10,7 @@ module Gobstones
|
|
10
10
|
status = output[:status]
|
11
11
|
result = output[:result]
|
12
12
|
|
13
|
-
|
14
|
-
result[:finalBoardError][:reason][:code] == 'timeout' &&
|
15
|
-
@options[:expect_endless_while]
|
16
|
-
|
17
|
-
return if is_expected_timeout
|
13
|
+
return if is_expected_timeout(result)
|
18
14
|
assert_not_boom status, result
|
19
15
|
|
20
16
|
expected_board = result[:extraBoard]
|
@@ -40,6 +36,8 @@ module Gobstones
|
|
40
36
|
status = output[:status]
|
41
37
|
result = output[:result]
|
42
38
|
|
39
|
+
return if is_expected_timeout(result)
|
40
|
+
|
43
41
|
fail_with status: :check_error_failed_expected_boom,
|
44
42
|
result: {
|
45
43
|
initial: result[:initialBoard],
|
@@ -97,6 +95,12 @@ module Gobstones
|
|
97
95
|
} if status == :runtime_error
|
98
96
|
end
|
99
97
|
|
98
|
+
def is_expected_timeout(result)
|
99
|
+
result[:finalBoardError] &&
|
100
|
+
result[:finalBoardError][:reason][:code] == 'timeout' &&
|
101
|
+
@options[:expect_endless_while]
|
102
|
+
end
|
103
|
+
|
100
104
|
def fail_with(error)
|
101
105
|
fail error.to_json
|
102
106
|
end
|
data/lib/gobstones_runner.rb
CHANGED
@@ -5,7 +5,7 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
|
|
5
5
|
|
6
6
|
Mumukit.runner_name = 'gobstones'
|
7
7
|
Mumukit.configure do |config|
|
8
|
-
config.docker_image = 'mumuki/mumuki-gobstones-worker:
|
8
|
+
config.docker_image = 'mumuki/mumuki-gobstones-worker:3.0'
|
9
9
|
config.content_type = 'html'
|
10
10
|
config.structured = true
|
11
11
|
end
|
data/lib/precompile_hook.rb
CHANGED
@@ -47,7 +47,7 @@ class GobstonesPrecompileHook < Mumukit::Templates::FileHook
|
|
47
47
|
def post_process_file(_file, result, status)
|
48
48
|
if status == :passed
|
49
49
|
result = result.parse_as_json
|
50
|
-
status = :aborted if is_timeout? result and
|
50
|
+
status = :aborted if is_timeout? result and !expects_timeout?
|
51
51
|
end
|
52
52
|
|
53
53
|
[result, status]
|
@@ -55,6 +55,10 @@ class GobstonesPrecompileHook < Mumukit::Templates::FileHook
|
|
55
55
|
|
56
56
|
private
|
57
57
|
|
58
|
+
def expects_timeout?
|
59
|
+
@batch.options[:expect_endless_while] || @batch.examples.any? { |it| it[:postconditions][:error] == 'timeout' }
|
60
|
+
end
|
61
|
+
|
58
62
|
def is_timeout?(result)
|
59
63
|
result[0]&.dig(:result, :finalBoardError, :reason, :code) === 'timeout'
|
60
64
|
end
|