mesa_test 1.1.2 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mesa_test +12 -5
  3. data/lib/mesa_test.rb +19 -16
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ef2c5c38af03ad5ebdf41472063fd0d1255de221e7402befc392d0f94d9d683
4
- data.tar.gz: 35afaaa02352b6a9a60759dfff51ad8312c756bdaa92fc7a480ff728a5d71660
3
+ metadata.gz: 62a113597b8d49b277030dabfb72f46b42bf4c6d33993d86fd3bd98c513bbf44
4
+ data.tar.gz: 355642660dddb5a4b87934c0f8fcb9c43a9fa4f900d8d809f62cda3cafcb8d89
5
5
  SHA512:
6
- metadata.gz: d7538fe20d847d901733db1a40dccb6426e5d5b66ee3b727f5394c45babb2baf082ab9576873447e5a25cec46972add717825a27e1a156bf31565d5b569f967d
7
- data.tar.gz: 10a7b0356b8b84f7f4e8df45f3d0b18a38f1ef30c71bd12b02947b83c6c23b29c778b3cbb9dfa04087fbf4454bf90bb92ecf7ecf9b2c02abf7bf0dfb765a3a70
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
- successfully_submitted = s.submit_commit(m) if options[:submit]
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
@@ -212,7 +212,7 @@ e-mail and password will be stored in plain text.'
212
212
  end
213
213
 
214
214
  def load_computer_data
215
- data_hash = YAML.safe_load(File.read(config_file), [Symbol])
215
+ data_hash = YAML.load(File.read(config_file))
216
216
  @computer_name = data_hash['computer_name']
217
217
  @email = data_hash['email']
218
218
  @password = data_hash['password']
@@ -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
- unless test_case.passed?
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
- return submit_test_log(test_case) unless test_case.passed?
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
- return true if !test_case.mesa.installed? || test_case.passed?
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
@@ -497,14 +501,13 @@ e-mail and password will be stored in plain text.'
497
501
 
498
502
  # report out results
499
503
  if !res.is_a? Net::HTTPOK
500
- shell.say "Failed to submit out.txt and mk.txt to the LOGS server for "\
501
- "test case #{test_case.test_name} in commit "\
502
- "#{test_case.mesa.sha}.", :red
504
+ shell.say "Failed to submit logs for test case #{test_case.test_name} "\
505
+ "in commit #{test_case.mesa.sha}.", :red
503
506
  false
504
507
  else
505
- shell.say "Successfully submitted out.txt and mk.txt to the LOGS "\
506
- "server for test case #{test_case.test_name} in commit "\
507
- "#{test_case.mesa.sha}.", :green
508
+ shell.say "Successfully submitted logs for test case "\
509
+ "#{test_case.test_name} in commit #{test_case.mesa.sha}.",
510
+ :green
508
511
  true
509
512
  end
510
513
  end
@@ -623,7 +626,7 @@ class Mesa
623
626
 
624
627
  def update_mirror
625
628
  shell.say "\nFetching MESA history...", :blue
626
- command = "git -C #{mirror_dir} fetch origin"
629
+ command = "git -C #{mirror_dir} fetch origin --prune"
627
630
  shell.say command
628
631
  # fail loudly
629
632
  return if bash_execute(command)
@@ -990,7 +993,7 @@ class MesaTestCase
990
993
  raise TestCaseDirError.new('No results found for test case '\
991
994
  "#{test_name}.")
992
995
  end
993
- YAML.safe_load(File.read(testhub_file), [Symbol])
996
+ YAML.load(File.read(testhub_file))
994
997
  end
995
998
 
996
999
  # whether or not a test case has passed; only has meaning
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.2
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-05-19 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubygems_version: 3.2.3
84
+ rubygems_version: 3.1.2
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Command line tool for running and reporting the MESA test suites.