mesa_test 1.1.8 → 1.1.10

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 +52 -49
  3. data/lib/mesa_test.rb +15 -14
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd52a22e9772094f32247bd8785a508f384ceaec1f32d7e6541920d92e730227
4
- data.tar.gz: 20b34824551a54e1fd529867d2451972168d663d0f7f799fa19c3e9293477360
3
+ metadata.gz: c2fda1f64ebdbf227fab03b74bda03425f5d3f42a0fa33311ecd80a8bc4e8090
4
+ data.tar.gz: c7d3984d5dbf5b0165a920bdc449b6400510f3889e85435c9a74ab26e5e97dd9
5
5
  SHA512:
6
- metadata.gz: 2ee0df9acc559f188b5dcb1dbab9124cc3cb379ad213aff5910943df367f753e8594d4b2bfee597a2c129f46523434a9e7c931707073c340b9db3ccd26fcc9c7
7
- data.tar.gz: d1cfbfe89e93881108f0fd5bbe7f0676e2812dbe8310549de9ca971ee044932904ad5062331019bef828d73322ac1aada2c439f0f4533ce2adee7dc51fe022d9
6
+ metadata.gz: 24e85244573b0fc8a824c58dc5123f63f1c70e273477879735781eb2a79e26a9aef4cb9aaa684a4fbee249a9cf07aa257a773277015d60c934c024d3dc799a64
7
+ data.tar.gz: 2a035af7f3f37f449f042ef39a0a30451a4d0396f3788a7255d10fb838918be1d7cff264c6c290aadc50980a98a7fb1eec5ac6a326f65fd530db1bb409f34226
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
@@ -446,7 +446,8 @@ e-mail and password will be stored in plain text.'
446
446
  # make generic request to LOGS server
447
447
  # +params+ is a hash of data to be encoded as JSON and sent off
448
448
  def submit_logs(params)
449
- uri = URI('https://logs.mesastar.org/uploads')
449
+ #uri = URI('https://logs.mesastar.org/uploads')
450
+ uri = URI('https://mesa-logs.flatironinstitute.org/uploads')
450
451
  https = Net::HTTP.new(uri.host, uri.port)
451
452
  https.use_ssl = true
452
453
  req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json',
@@ -609,11 +610,11 @@ class Mesa
609
610
  end
610
611
  end
611
612
 
612
- update_mirror
613
-
614
613
  # ensure "work" directory is removed from worktree
615
614
  remove
616
615
 
616
+ update_mirror
617
+
617
618
  # create "work" directory with proper commit
618
619
  shell.say "\nSetting up worktree repo...", :blue
619
620
  FileUtils.mkdir_p mesa_dir
@@ -813,16 +814,6 @@ class Mesa
813
814
  File.exist? File.join(mesa_dir, 'testhub.yml')
814
815
  end
815
816
 
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
817
  # change MESA_DIR for the execution of the block and then revert to the
827
818
  # original value
828
819
  def with_mesa_dir
@@ -830,7 +821,7 @@ class Mesa
830
821
  orig_mesa_dir = ENV['MESA_DIR']
831
822
  ENV['MESA_DIR'] = mesa_dir
832
823
  shell.say "Temporarily changed MESA_DIR to #{ENV['MESA_DIR']}.", :blue
833
-
824
+
834
825
  # do the stuff
835
826
  begin
836
827
  yield
@@ -841,6 +832,16 @@ class Mesa
841
832
  end
842
833
  end
843
834
 
835
+ private
836
+
837
+ # verify that mesa_dir is valid by checking for existence of test_suite
838
+ # directory for each module (somewhat arbitrary)
839
+ def check_mesa_dir
840
+ MesaTestCase.modules.inject(true) do |res, mod|
841
+ res && dir_or_symlink_exists?(test_suite_dir(mod: mod))
842
+ end
843
+ end
844
+
844
845
  def all_names_ordered(mod: :all)
845
846
  load_test_source_data unless @names_to_numbers
846
847
  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.10
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: 2024-11-14 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.1.2
84
+ rubygems_version: 3.4.18
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Command line tool for running and reporting the MESA test suites.