From 2901164c1cb94581d851728a50cd107c855e7d51 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Mon, 8 Nov 2021 09:58:52 -0500 Subject: [PATCH 1/6] stub out windows test --- .github/workflows/test.yaml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c264439fc..87f84fb3d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -54,6 +54,45 @@ jobs: WebKit/WebKitBuild/Release/bin/jsc builds/out-adv/core-advanced-test.js | tee test-out.txt grep -qxF '0 failures, 0 errors.' test-out.txt + # Runtime Tests + runtime-windows-test: + name: Runtime Windows Tests + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + + - uses: DeLaGuardo/setup-clojure@3.1 + with: + tools-deps: '1.10.1.763' + + - name: Cache maven + uses: actions/cache@v2 + env: + cache-name: cache-maven + with: + path: ~/.m2 + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }} + restore-keys: | + ${{ runner.os }}-${{ env.cache-name }}- + + - name: Cache gitlibs + uses: actions/cache@v2 + env: + cache-name: cache-gitlibs + with: + path: ~/.gitlibs + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }} + restore-keys: | + ${{ runner.os }}-${{ env.cache-name }}- + + - name: Build tests + run: clojure -M:runtime.test.build + + - name: Run tests + run: | + node builds/out-adv/core-advanced-test.js | tee test-out.txt + grep -qxF '0 failures, 0 errors.' test-out.txt + # Self-host Tests self-host-test: name: Self-host Tests From 1c653c3d816f3e7f9e9e3e97c08515f4307dc6a9 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Mon, 8 Nov 2021 10:06:07 -0500 Subject: [PATCH 2/6] simplify window gh action --- .github/workflows/test.yaml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 87f84fb3d..0a4ab24b5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -61,37 +61,19 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: DeLaGuardo/setup-clojure@3.1 - with: - tools-deps: '1.10.1.763' - - - name: Cache maven - uses: actions/cache@v2 - env: - cache-name: cache-maven - with: - path: ~/.m2 - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - - - name: Cache gitlibs - uses: actions/cache@v2 - env: - cache-name: cache-gitlibs + - uses: DeLaGuardo/setup-clojure@3.5 with: - path: ~/.gitlibs - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- + cli: '1.10.1.763' - name: Build tests run: clojure -M:runtime.test.build + shell: powershell - name: Run tests run: | node builds/out-adv/core-advanced-test.js | tee test-out.txt grep -qxF '0 failures, 0 errors.' test-out.txt + shell: powershell # Self-host Tests self-host-test: From 95a7d312fca2d196f48943196f4b9053b21de464 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Mon, 8 Nov 2021 10:14:07 -0500 Subject: [PATCH 3/6] cleanup resource->source-file --- src/main/clojure/cljs/externs.clj | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/clojure/cljs/externs.clj b/src/main/clojure/cljs/externs.clj index b7b42fa36..e940461e7 100644 --- a/src/main/clojure/cljs/externs.clj +++ b/src/main/clojure/cljs/externs.clj @@ -16,7 +16,8 @@ [com.google.javascript.jscomp.parsing Config$JsDocParsing] [com.google.javascript.rhino Node Token JSTypeExpression JSDocInfo$Visibility] - [java.util.logging Level])) + [java.util.logging Level] + [java.net URL])) (def ^:dynamic *ignore-var* false) (def ^:dynamic *source-file* nil) @@ -288,9 +289,9 @@ {} externs)))) (defn resource->source-file - [resource] + [^URL resource] (-> (SourceFile/builder) - (.withPath (.toPath (io/file (.getPath resource)))) + (.withPath (.getPath resource)) (.withContent (io/input-stream resource)) (.build))) @@ -313,6 +314,8 @@ '[clojure.pprint :refer [pprint]] '[cljs.js-deps :as js-deps]) + (resource->source-file (io/resource "goog/dom/dom.js")) + (pprint (get-in (analyze-goog-file "goog/dom/dom.js") [:defs 'setTextContent])) From af1bbf2970da56c6ef118b385b5521ed867cd4d3 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Mon, 8 Nov 2021 10:30:41 -0500 Subject: [PATCH 4/6] enable console print if js/print is not available --- src/test/cljs/test_runner.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/cljs/test_runner.cljs b/src/test/cljs/test_runner.cljs index 7a6023c85..0c2900009 100644 --- a/src/test/cljs/test_runner.cljs +++ b/src/test/cljs/test_runner.cljs @@ -56,7 +56,11 @@ [cljs.extend-to-native-test])) (set! *print-newline* false) -(set-print-fn! js/print) + +;; When testing Windows we default to Node.js +(if (exists? js/print) + (set-print-fn! js/print) + (enable-console-print!)) (run-tests 'cljs.apply-test From a3dcd2e0fe07f39c96910681f126291112ad9a98 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Mon, 8 Nov 2021 10:46:52 -0500 Subject: [PATCH 5/6] grep --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0a4ab24b5..f56a16e9c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -72,7 +72,7 @@ jobs: - name: Run tests run: | node builds/out-adv/core-advanced-test.js | tee test-out.txt - grep -qxF '0 failures, 0 errors.' test-out.txt + grep -qxF "0 failures, 0 errors." test-out.txt shell: powershell # Self-host Tests From baccef917e3dc2139a6b4e1167b7f6e58825dfb1 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Mon, 8 Nov 2021 10:58:08 -0500 Subject: [PATCH 6/6] try findstr --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f56a16e9c..a7e4fca73 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -72,7 +72,7 @@ jobs: - name: Run tests run: | node builds/out-adv/core-advanced-test.js | tee test-out.txt - grep -qxF "0 failures, 0 errors." test-out.txt + findstr "0 failures, 0 errors." test-out.txt shell: powershell # Self-host Tests