mesa_test 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/mesa_test +52 -49
  3. data/lib/mesa_test.rb +13 -13
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd52a22e9772094f32247bd8785a508f384ceaec1f32d7e6541920d92e730227
4
- data.tar.gz: 20b34824551a54e1fd529867d2451972168d663d0f7f799fa19c3e9293477360
3
+ metadata.gz: b1bc3ecd06c1d2cc95d041b7171dc9c6cda0ccb6536beec798f3969b8f8aa87d
4
+ data.tar.gz: 4c0109db46572db7e9dc3d2f2aa0dda259b21ba5049448874d5a0d1ec7a85d6a
5
5
  SHA512:
6
- metadata.gz: 2ee0df9acc559f188b5dcb1dbab9124cc3cb379ad213aff5910943df367f753e8594d4b2bfee597a2c129f46523434a9e7c931707073c340b9db3ccd26fcc9c7
7
- data.tar.gz: d1cfbfe89e93881108f0fd5bbe7f0676e2812dbe8310549de9ca971ee044932904ad5062331019bef828d73322ac1aada2c439f0f4533ce2adee7dc51fe022d9
6
+ metadata.gz: f28bd6704f63e5e37c9fc1bf253458012587febf4c11278e143ec2edf10d826d4c37a183cf0a870c6e92419c2145509407cc3cee37136ee43b02035d7f6254d0
7
+ data.tar.gz: 92055286204281167d4655278e9b36c35c4bc1c4de04fb8e41180d19cbc21d71f4b50d5f2489628068ffc79bf1fb0794e164b4f6dcdadac2ad46e31cf34c98d8
data/bin/mesa_test CHANGED
@@ -57,29 +57,31 @@ class MesaTest < Thor
57
57
  mod: options[:module].downcase.to_sym,
58
58
  github_protocol: s.github_protocol
59
59
  )
60
- if test_case_name
61
- # only testing one test case
62
- t = create_and_check_test_case(mesa: m, test_case_name: test_case_name,
63
- mod: options[:module].downcase.to_sym)
64
-
65
- # run test
66
- t.do_one
67
-
68
- # bail out if not submitting
69
- return unless options[:submit]
70
-
71
- # submit results
72
- shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
73
- s.submit_instance(m, t, force_logs: options['force-logs'])
74
- else
75
- # run all tests
76
- m.each_test_run(mod: options[:module].downcase.to_sym)
77
-
78
- # bail out if not submitting
79
- return unless options[:submit]
80
-
81
- shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
82
- s.submit_commit(m, force_logs: options['force-logs'])
60
+ m.with_mesa_dir do
61
+ if test_case_name
62
+ # only testing one test case
63
+ t = create_and_check_test_case(mesa: m, test_case_name: test_case_name,
64
+ mod: options[:module].downcase.to_sym)
65
+
66
+ # run test
67
+ t.do_one
68
+
69
+ # bail out if not submitting
70
+ return unless options[:submit]
71
+
72
+ # submit results
73
+ shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
74
+ s.submit_instance(m, t, force_logs: options['force-logs'])
75
+ else
76
+ # run all tests
77
+ m.each_test_run(mod: options[:module].downcase.to_sym)
78
+
79
+ # bail out if not submitting
80
+ return unless options[:submit]
81
+
82
+ shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
83
+ s.submit_commit(m, force_logs: options['force-logs'])
84
+ end
83
85
  end
84
86
  shell.say "Done.\n", :green
85
87
  end
@@ -123,31 +125,32 @@ class MesaTest < Thor
123
125
 
124
126
  # default value for now; might change to false if we have a bad
125
127
  # installation or if a test case is specified
126
-
127
- if test_case_name
128
- # just submitting one test case.
129
- # this is not an empty submission since there is one test case (the
130
- # +empty+ option is ignored in this case)
131
-
132
- t = create_and_check_test_case(mesa: m, test_case_name: test_case_name,
133
- mod: options[:module].downcase.to_sym)
134
- # submit results
135
- shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
136
- s.submit_instance(m, t, force_logs: options['force-logs'])
137
- shell.say "Done.\n", :green
138
- else
139
- # submitting compilation information and either all tests (entire) or
140
- # no tests (empty)
141
- begin
142
- m.check_installation
143
- rescue MesaDirError
144
- shell.say %q{This MESA installation doesn't seem to be compiled } \
145
- 'properly. Attempting to submit a compilation failure to '\
146
- 'MESATestHub.', :red
147
- empty = true
148
- ensure
149
- # submit all tests
150
- s.submit_commit(m, empty: empty, force_logs: options['force-logs'])
128
+ m.with_mesa_dir do
129
+ if test_case_name
130
+ # just submitting one test case.
131
+ # this is not an empty submission since there is one test case (the
132
+ # +empty+ option is ignored in this case)
133
+
134
+ t = create_and_check_test_case(mesa: m, test_case_name: test_case_name,
135
+ mod: options[:module].downcase.to_sym)
136
+ # submit results
137
+ shell.say 'Submitting results to ' + s.base_uri + '... ', :blue
138
+ s.submit_instance(m, t, force_logs: options['force-logs'])
139
+ shell.say "Done.\n", :green
140
+ else
141
+ # submitting compilation information and either all tests (entire) or
142
+ # no tests (empty)
143
+ begin
144
+ m.check_installation
145
+ rescue MesaDirError
146
+ shell.say %q{This MESA installation doesn't seem to be compiled } \
147
+ 'properly. Attempting to submit a compilation failure to '\
148
+ 'MESATestHub.', :red
149
+ empty = true
150
+ ensure
151
+ # submit all tests
152
+ s.submit_commit(m, empty: empty, force_logs: options['force-logs'])
153
+ end
151
154
  end
152
155
  end
153
156
  end
@@ -298,7 +301,7 @@ class MesaTest < Thor
298
301
 
299
302
  # run all tests. Don't be fooled, whether or not a diff happens is set
300
303
  # by the diff attribute of the mesa object, set above.
301
- m.each_test_run(mod: options[:module].downcase.to_sym)
304
+ m.with_mesa_dir { m.each_test_run(mod: options[:module].downcase.to_sym) }
302
305
  ensure
303
306
  # submit all commit and test data
304
307
  successfully_submitted = false
data/lib/mesa_test.rb CHANGED
@@ -609,11 +609,11 @@ class Mesa
609
609
  end
610
610
  end
611
611
 
612
- update_mirror
613
-
614
612
  # ensure "work" directory is removed from worktree
615
613
  remove
616
614
 
615
+ update_mirror
616
+
617
617
  # create "work" directory with proper commit
618
618
  shell.say "\nSetting up worktree repo...", :blue
619
619
  FileUtils.mkdir_p mesa_dir
@@ -813,16 +813,6 @@ class Mesa
813
813
  File.exist? File.join(mesa_dir, 'testhub.yml')
814
814
  end
815
815
 
816
- private
817
-
818
- # verify that mesa_dir is valid by checking for existence of test_suite
819
- # directory for each module (somewhat arbitrary)
820
- def check_mesa_dir
821
- MesaTestCase.modules.inject(true) do |res, mod|
822
- res && dir_or_symlink_exists?(test_suite_dir(mod: mod))
823
- end
824
- end
825
-
826
816
  # change MESA_DIR for the execution of the block and then revert to the
827
817
  # original value
828
818
  def with_mesa_dir
@@ -830,7 +820,7 @@ class Mesa
830
820
  orig_mesa_dir = ENV['MESA_DIR']
831
821
  ENV['MESA_DIR'] = mesa_dir
832
822
  shell.say "Temporarily changed MESA_DIR to #{ENV['MESA_DIR']}.", :blue
833
-
823
+
834
824
  # do the stuff
835
825
  begin
836
826
  yield
@@ -841,6 +831,16 @@ class Mesa
841
831
  end
842
832
  end
843
833
 
834
+ private
835
+
836
+ # verify that mesa_dir is valid by checking for existence of test_suite
837
+ # directory for each module (somewhat arbitrary)
838
+ def check_mesa_dir
839
+ MesaTestCase.modules.inject(true) do |res, mod|
840
+ res && dir_or_symlink_exists?(test_suite_dir(mod: mod))
841
+ end
842
+ end
843
+
844
844
  def all_names_ordered(mod: :all)
845
845
  load_test_source_data unless @names_to_numbers
846
846
  if mod == :all
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.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Wolf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-01 00:00:00.000000000 Z
11
+ date: 2022-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json