diff --git a/test-resources/lib_tests/babashka/run_all_libtests.clj b/test-resources/lib_tests/babashka/run_all_libtests.clj index 092263f8..a5092434 100644 --- a/test-resources/lib_tests/babashka/run_all_libtests.clj +++ b/test-resources/lib_tests/babashka/run_all_libtests.clj @@ -3,6 +3,7 @@ [babashka.classpath :as cp :refer [add-classpath]] [babashka.core :refer [windows?]] [babashka.fs :as fs] + [babashka.process :refer [sh]] [clojure.edn :as edn] [clojure.java.io :as io] [clojure.spec.test.alpha :as st] @@ -53,18 +54,30 @@ (swap! status (fn [status] (merge-with + status (dissoc m :type)))))))))))) +(defn current-branch [] + (or (System/getenv "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH") + (System/getenv "APPVEYOR_REPO_BRANCH") + (System/getenv "CIRCLE_BRANCH") + (System/getenv "GITHUB_REF_NAME") + (System/getenv "CIRRUS_BRANCH") + (-> (sh "git" "rev-parse" "--abbrev-ref" "HEAD") + :out + str/trim))) + ;; Standard test-runner for libtests (let [lib-tests (edn/read-string (slurp (io/resource "bb-tested-libs.edn"))) test-nss (atom [])] (doseq [[libname {tns :test-namespaces skip-windows :skip-windows :keys [test-paths - git-sha]}] lib-tests] + git-sha flaky]}] lib-tests] (let [git-dir (format ".gitlibs/libs/%s/%s" libname git-sha) git-dir (fs/file (fs/home) git-dir)] (doseq [p test-paths] (add-classpath (str (fs/file git-dir p))))) (when-not (and skip-windows (windows?)) - (swap! test-nss into tns))) + (if (and flaky (#{"main" "master"} (current-branch))) + (println "Skipping" tns "for main branch because it's marked flaky") + (swap! test-nss into tns)))) (apply test-namespaces @test-nss)) ;; Non-standard tests - These are tests with unusual setup around test-namespaces diff --git a/test-resources/lib_tests/bb-tested-libs.edn b/test-resources/lib_tests/bb-tested-libs.edn index d549dfa2..91d501f4 100644 --- a/test-resources/lib_tests/bb-tested-libs.edn +++ b/test-resources/lib_tests/bb-tested-libs.edn @@ -57,8 +57,8 @@ crispin/crispin {:git-url "https://github.com/dunaj-project/crispin", :test-namespaces [crispin.core-test], :manually-added true} clj-commons/multigrep {:git-url "https://github.com/clj-commons/multigrep", :test-namespaces [multigrep.core-test], :manually-added true} org.clj-commons/digest {:git-url "https://github.com/clj-commons/clj-digest", :test-namespaces [clj-commons.digest-test], :manually-added true} - hato/hato {:git-url "https://github.com/gnarroway/hato", :test-namespaces [hato.client-test], :manually-added true} - java-http-clj/java-http-clj {:git-url "http://www.github.com/schmee/java-http-clj", :test-namespaces [java-http-clj.smoke-test], :manually-added true} + hato/hato {:git-url "https://github.com/gnarroway/hato", :test-namespaces [hato.client-test], :manually-added true :flaky true} + java-http-clj/java-http-clj {:git-url "http://www.github.com/schmee/java-http-clj", :test-namespaces [java-http-clj.smoke-test], :manually-added true :flaky true} rewrite-clj/rewrite-clj {:git-url "https://github.com/clj-commons/rewrite-clj", :test-namespaces [rewrite-clj.parser-test rewrite-clj.node-test rewrite-clj.zip-test rewrite-clj.paredit-test rewrite-clj.zip.subedit-test rewrite-clj.node.coercer-test], :manually-added true} ;; TODO: env tests don't work because envoy lib isn't compatible with bb ;; TODO: failing tests in the following namespaces: vault.client.mock-test, vault.secrets.kvv1-test vault.secrets.kvv2-test