]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: disable benchmarks in a better way to get travis and macs unstuck.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 22 Dec 2017 17:40:50 +0000 (11:40 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 22 Dec 2017 17:40:50 +0000 (11:40 -0600)
.travis.yml
extra/benchmark/benchmark.factor
extra/mason/report/report.factor
extra/mason/test/test.factor

index 43ad8fd9fa0e915b40147746d1a24718a4c7e6e3..caf8bfca077dd38d4b156c562387a104fde8955d 100644 (file)
@@ -50,7 +50,7 @@ script: >
   ( echo "=== Factor Configure Postgresql ===" ; ./factor -e='USING: db.postgresql namespaces memory ; T{ postgresql-db f "localhost" f f f f "postgres" "" } \ postgresql-db set-global save' ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ] ) &&
   ( echo "=== Factor Configure Imap ===" ; ./factor -e='USING: imap namespaces memory environment accessors ; T{ imap-settings { host "imap.gmail.com" }  } "FACTOR_IMAP_USER" os-env >>email "FACTOR_IMAP_PASSWORD" os-env >>password \ imap-settings set-global save' ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ] ) &&
   ( echo "=== Mkdir ===" ; mkdir -p mason/builds ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ] ) &&
-  ( echo "=== Factor tests ===" ; cd mason/builds && ../../factor -e='USING: namespaces tools.test mason.test ; f long-unit-tests-enabled? set-global t skip-mason-benchmarks set-global do-all' < /dev/null | awk 'NR<1000 || /^Loading resource|Unit Test/' ; ret=${PIPESTATUS[0]} ; echo "=== $ret ==="; [ $ret == 0 ]) &&
+  ( echo "=== Factor tests ===" ; cd mason/builds && ../../factor -e='USING: namespaces tools.test mason.test benchmark ; f long-unit-tests-enabled? set-global t benchmarks-disabled? set-global do-all' < /dev/null | awk 'NR<1000 || /^Loading resource|Unit Test/' ; ret=${PIPESTATUS[0]} ; echo "=== $ret ==="; [ $ret == 0 ]) &&
   ( echo "=== Factor report === " ; cd mason && ../factor -e='USING: mason.config mason.report namespaces ; "." builds-dir [ successful-report ] with-variable'  ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ]) &&
   ( echo "=== Dump report === " ;[[ "$TRAVIS_OS_NAME" != "osx" ]] && links -dump mason/report || cat mason/report  ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ]) &&
   [ ! -s mason/test-all-errors ]
index c3b1c97426712a9f5cc37ef99ce566d999bfd9ba..46f23009f675b1a6907ba6957e05d0a7b8551b86 100644 (file)
@@ -6,6 +6,8 @@ sequences tools.profiler.sampling tools.test tools.time
 vocabs.hierarchy vocabs.loader ;
 IN: benchmark
 
+SYMBOL: benchmarks-disabled?
+
 : run-timing-benchmark ( vocab -- time )
     5 swap '[ gc [ _ run ] benchmark ] replicate infimum ;
 
@@ -16,7 +18,12 @@ IN: benchmark
     "benchmark" disk-child-vocab-names [ find-vocab-root ] filter ;
 
 : find-benchmark-vocabs ( -- seq )
-    command-line get [ all-benchmark-vocabs ] when-empty ;
+    benchmarks-disabled? get [
+        "benchmarks-disabled? is true, not benchmarking anything!" print
+        { }
+    ] [
+        command-line get [ all-benchmark-vocabs ] when-empty
+    ] if ;
 
 <PRIVATE
 
index f41d7e9aceb8fa9f7f4bde3165f9aa36dc147152..d8447c24e121d2f4dfedf9a41e1f9f901dbb3a95 100644 (file)
@@ -123,17 +123,12 @@ IN: mason.report
             help-lint-errors-file
             error-dump
 
-            skip-mason-benchmarks get-global [
-                f f
-            ] [
-                "Benchmark errors"
-                benchmark-error-vocabs-file
-                benchmark-error-messages-file
-                error-dump
-
-                benchmarks-file eval-file benchmarks-table
-            ] if
+            "Benchmark errors"
+            benchmark-error-vocabs-file
+            benchmark-error-messages-file
+            error-dump
 
+            benchmarks-file eval-file benchmarks-table
         ] output>array sift
     ] with-report ;
 
@@ -143,7 +138,7 @@ IN: mason.report
         test-all-vocabs-file
         help-lint-vocabs-file
         compiler-errors-file
-        skip-mason-benchmarks get [ t ] [ benchmark-error-vocabs-file ] if
+        benchmark-error-vocabs-file
     } [ eval-file empty? ] all? ;
 
 : success ( -- status )
index 420e3b9eb300b4cc6dd17cf29aa16ccc1271b51f..bd2e9dc50aa0bdb08f280a07b9a5818c59f43ff2 100644 (file)
@@ -101,8 +101,6 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
     user-init-errors get-global assoc-empty?
     [ f ] [ :user-init-errors t ] if ;
 
-SYMBOL: skip-mason-benchmarks
-
 : do-all ( -- )
     f parser-quiet? set-global
     f restartable-tests? set-global
@@ -114,15 +112,7 @@ SYMBOL: skip-mason-benchmarks
         [ generate-help ] benchmark html-help-time-file to-file
         [ do-tests ] benchmark test-time-file to-file
         [ do-help-lint ] benchmark help-lint-time-file to-file
-        ! Because of the way mason is written, it expects these files to exist.
-        ! So fake them.
-        skip-mason-benchmarks get [
-            { } benchmarks-file to-file
-            benchmark-error-messages-file touch-file
-            0 benchmark-time-file to-file
-        ] [
-            [ do-benchmarks ] benchmark benchmark-time-file to-file
-        ] if
+        [ do-benchmarks ] benchmark benchmark-time-file to-file
         do-compile-errors
     ] with-directory ;