mesa_test 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/lib/mesa_test.rb +25 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae698f83ffe3b76ef2a0b053c751ffe69a7122fa656b26ed8e208b4fc71543c4
|
4
|
+
data.tar.gz: ea75570ccd182d43d362c7c8a58fdd8595854664a3a8ba764d535514fdc00b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b24851cee6d1e5fdfbaf5678654269742fd6890608784fbb513a5e7089260dc06a201db031f1c4c1763e4d5b91d052fd03acb96a11840abaf6f4b44ed59e510d
|
7
|
+
data.tar.gz: 9aa56e5f062faeb96996cf9982cb15ba16f445f3002529ab2d7a341fe3988cb5015fcd70362e776f4916b928b8fa73a1c3199ed1979d601015e6172c88c7b075
|
data/lib/mesa_test.rb
CHANGED
@@ -302,6 +302,10 @@ e-mail and password will be stored in plain text.'
|
|
302
302
|
# submit entire commit's worth of test cases, OR submit compilation status
|
303
303
|
# and NO test cases
|
304
304
|
def submit_commit(mesa, empty: false)
|
305
|
+
unless mesa.install_attempted?
|
306
|
+
raise MesaDirError, 'No testhub.yml file found in installation; '\
|
307
|
+
'must attempt to install before subitting.'
|
308
|
+
end
|
305
309
|
uri = URI.parse(base_uri + '/submissions/create.json')
|
306
310
|
https = Net::HTTP.new(uri.hostname, uri.port)
|
307
311
|
https.use_ssl = true if base_uri.include? 'https'
|
@@ -341,6 +345,11 @@ e-mail and password will be stored in plain text.'
|
|
341
345
|
# submit results for a single test case instance. Does *not* report overall
|
342
346
|
# compilation status to testhub. Use an empty commit submission for that
|
343
347
|
def submit_instance(mesa, test_case)
|
348
|
+
unless mesa.install_attempted?
|
349
|
+
raise MesaDirError, 'No testhub.yml file found in installation; '\
|
350
|
+
'must attempt to install before subitting.'
|
351
|
+
end
|
352
|
+
|
344
353
|
uri = URI.parse(base_uri + '/submissions/create.json')
|
345
354
|
https = Net::HTTP.new(uri.hostname, uri.port)
|
346
355
|
https.use_ssl = true if base_uri.include? 'https'
|
@@ -557,14 +566,17 @@ class Mesa
|
|
557
566
|
# installation
|
558
567
|
def compiler_hash
|
559
568
|
data_file = File.join(mesa_dir, 'testhub.yml')
|
560
|
-
|
561
|
-
|
569
|
+
res = {
|
570
|
+
compiler: 'Unknown',
|
571
|
+
sdk_version: 'Unknown',
|
572
|
+
math_backend: 'Unknown'
|
573
|
+
}
|
574
|
+
if File.exist? data_file
|
575
|
+
res = res.merge(YAML.safe_load(File.read(data_file)) || {})
|
576
|
+
# currently version_number is reported, but we don't need that in Git land
|
577
|
+
res.delete('version_number') # returns the value, not the updated hash
|
578
|
+
res
|
562
579
|
end
|
563
|
-
|
564
|
-
res = YAML.safe_load(File.read(data_file))
|
565
|
-
# currently version_number is reported, but we don't need that in Git land
|
566
|
-
res.delete('version_number') # returns the value, not the updated hash
|
567
|
-
res
|
568
580
|
end
|
569
581
|
|
570
582
|
## TEST SUITE METHODS
|
@@ -647,11 +659,16 @@ class Mesa
|
|
647
659
|
def installed?
|
648
660
|
# assume build log reflects installation status; does not account for
|
649
661
|
# mucking with modules after the fact
|
650
|
-
|
662
|
+
build_log = File.join(mesa_dir, 'build.log')
|
663
|
+
downloaded? && File.exist?(build_log) && File.read(build_log).include?(
|
651
664
|
'MESA installation was successful'
|
652
665
|
)
|
653
666
|
end
|
654
667
|
|
668
|
+
def install_attempted?
|
669
|
+
File.exist? File.join(mesa_dir, 'testhub.yml')
|
670
|
+
end
|
671
|
+
|
655
672
|
private
|
656
673
|
|
657
674
|
# verify that mesa_dir is valid by checking for existence of test_suite
|