mesa_test 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mesa_test +12 -5
- data/lib/mesa_test.rb +12 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62a113597b8d49b277030dabfb72f46b42bf4c6d33993d86fd3bd98c513bbf44
|
4
|
+
data.tar.gz: 355642660dddb5a4b87934c0f8fcb9c43a9fa4f900d8d809f62cda3cafcb8d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6db7a9183094ce00ca25adc3c51a02570a4d381432be02ee61ebf48d774b4e90904f61171e8530f8db6f2b6dc819bc78ff644ec8e85ff4b0da5d45ea70bf9f37
|
7
|
+
data.tar.gz: a42908b873207b17ed8195f26c4bde8dd479e2c69dc49e3f2a406e4190109f95522aeb466741b2f18fd1d9966356bf22b7539ec2630af37322b7544bc3ac4cfc
|
data/bin/mesa_test
CHANGED
@@ -36,6 +36,8 @@ class MesaTest < Thor
|
|
36
36
|
'~/.mesa_test.yml are correct rather than checking ' \
|
37
37
|
'with user.',
|
38
38
|
type: :boolean, default: true, aliases: '-f'
|
39
|
+
option 'force-logs', desc: 'Submit logs for test case(s), even if they pass',
|
40
|
+
type: :boolean, default: false
|
39
41
|
option :submit, desc: 'Submit results (if any) to MesaTestHub.',
|
40
42
|
type: :boolean, default: true
|
41
43
|
option :module, desc: 'Which module to test and/or submit, if applicable.',
|
@@ -68,7 +70,7 @@ class MesaTest < Thor
|
|
68
70
|
|
69
71
|
# submit results
|
70
72
|
shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
|
71
|
-
s.submit_instance(m, t)
|
73
|
+
s.submit_instance(m, t, force_logs: options['force-logs'])
|
72
74
|
else
|
73
75
|
# run all tests
|
74
76
|
m.each_test_run(mod: options[:module].downcase.to_sym)
|
@@ -77,7 +79,7 @@ class MesaTest < Thor
|
|
77
79
|
return unless options[:submit]
|
78
80
|
|
79
81
|
shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
|
80
|
-
s.submit_commit(m)
|
82
|
+
s.submit_commit(m, force_logs: options['force-logs'])
|
81
83
|
end
|
82
84
|
shell.say "Done.\n", :green
|
83
85
|
end
|
@@ -98,6 +100,8 @@ class MesaTest < Thor
|
|
98
100
|
'~/.mesa_test.yml are correct rather than checking ' \
|
99
101
|
'with user.',
|
100
102
|
type: :boolean, default: true, aliases: '-f'
|
103
|
+
option 'force-logs', desc: 'Submit logs for test case(s), even if they pass',
|
104
|
+
type: :boolean, default: false
|
101
105
|
option :module, desc: 'Which module to test and/or submit, if applicable.',
|
102
106
|
type: :string, default: 'all', aliases: '-m'
|
103
107
|
option :empty, desc: 'Whether any test cases will be submitted. Useful for '\
|
@@ -129,7 +133,7 @@ class MesaTest < Thor
|
|
129
133
|
mod: options[:module].downcase.to_sym)
|
130
134
|
# submit results
|
131
135
|
shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
|
132
|
-
s.submit_instance(m, t)
|
136
|
+
s.submit_instance(m, t, force_logs: options['force-logs'])
|
133
137
|
shell.say "Done.\n", :green
|
134
138
|
else
|
135
139
|
# submitting compilation information and either all tests (entire) or
|
@@ -143,7 +147,7 @@ class MesaTest < Thor
|
|
143
147
|
empty = true
|
144
148
|
ensure
|
145
149
|
# submit all tests
|
146
|
-
s.submit_commit(m, empty: empty)
|
150
|
+
s.submit_commit(m, empty: empty, force_logs: options['force-logs'])
|
147
151
|
end
|
148
152
|
end
|
149
153
|
end
|
@@ -298,7 +302,10 @@ class MesaTest < Thor
|
|
298
302
|
ensure
|
299
303
|
# submit all commit and test data
|
300
304
|
successfully_submitted = false
|
301
|
-
|
305
|
+
if options[:submit]
|
306
|
+
successfully_submitted = s.submit_commit(
|
307
|
+
m, force_logs: options['force-logs'])
|
308
|
+
end
|
302
309
|
|
303
310
|
# if requested, installation and submission are successful, destroy the
|
304
311
|
# directory
|
data/lib/mesa_test.rb
CHANGED
@@ -334,7 +334,7 @@ e-mail and password will be stored in plain text.'
|
|
334
334
|
|
335
335
|
# submit entire commit's worth of test cases, OR submit compilation status
|
336
336
|
# and NO test cases
|
337
|
-
def submit_commit(mesa, empty: false)
|
337
|
+
def submit_commit(mesa, empty: false, force_logs: false)
|
338
338
|
unless mesa.install_attempted?
|
339
339
|
raise MesaDirError, 'No testhub.yml file found in installation; '\
|
340
340
|
'must attempt to install before subitting.'
|
@@ -386,8 +386,8 @@ e-mail and password will be stored in plain text.'
|
|
386
386
|
test_case_hash.each do |tc_name, test_case|
|
387
387
|
# get at each individual test case, see if it failed, and if it
|
388
388
|
# did, submit its log files
|
389
|
-
|
390
|
-
res &&= submit_test_log(test_case)
|
389
|
+
if !test_case.passed? || force_logs
|
390
|
+
res &&= submit_test_log(test_case, skip_passing: !force_logs)
|
391
391
|
end
|
392
392
|
end
|
393
393
|
end
|
@@ -401,7 +401,7 @@ e-mail and password will be stored in plain text.'
|
|
401
401
|
|
402
402
|
# submit results for a single test case instance. Does *not* report overall
|
403
403
|
# compilation status to testhub. Use an empty commit submission for that
|
404
|
-
def submit_instance(mesa, test_case)
|
404
|
+
def submit_instance(mesa, test_case, force_logs: false)
|
405
405
|
unless mesa.install_attempted?
|
406
406
|
raise MesaDirError, 'No testhub.yml file found in installation; '\
|
407
407
|
'must attempt to install before subitting.'
|
@@ -436,7 +436,9 @@ e-mail and password will be stored in plain text.'
|
|
436
436
|
shell.say "\nSuccessfully submitted instance of #{test_case.test_name} "\
|
437
437
|
"for commit #{mesa.sha}.", :green
|
438
438
|
# submit logs if test failed
|
439
|
-
|
439
|
+
if !test_case.passed? || force_logs
|
440
|
+
return submit_test_log(test_case, skip_passing: !force_logs)
|
441
|
+
end
|
440
442
|
true
|
441
443
|
end
|
442
444
|
end
|
@@ -481,9 +483,11 @@ e-mail and password will be stored in plain text.'
|
|
481
483
|
end
|
482
484
|
|
483
485
|
# send build log to the logs server
|
484
|
-
def submit_test_log(test_case)
|
486
|
+
def submit_test_log(test_case, skip_passing: true)
|
485
487
|
# skip submission if mesa was never installed or if the test passed
|
486
|
-
|
488
|
+
if !test_case.mesa.installed? || (test_case.passed? && skip_passing)
|
489
|
+
return true
|
490
|
+
end
|
487
491
|
|
488
492
|
# don't even try unless we have a logs token set
|
489
493
|
unless logs_token
|
@@ -622,7 +626,7 @@ class Mesa
|
|
622
626
|
|
623
627
|
def update_mirror
|
624
628
|
shell.say "\nFetching MESA history...", :blue
|
625
|
-
command = "git -C #{mirror_dir} fetch origin"
|
629
|
+
command = "git -C #{mirror_dir} fetch origin --prune"
|
626
630
|
shell.say command
|
627
631
|
# fail loudly
|
628
632
|
return if bash_execute(command)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mesa_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Wolf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|