Skip flaky tests on main

This commit is contained in:
Michiel Borkent 2023-01-05 12:15:20 +01:00
parent a0a34dc5d8
commit 9e1ea1071d
2 changed files with 17 additions and 4 deletions

View file

@ -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

View file

@ -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