Skip to content

Commit

Permalink
Run clojure tests on commits to math (compdemocracy#506)
Browse files Browse the repository at this point in the history
* Added closure testing workflow on GitHub Actions.

* Added feature branch to force testing while PR.

* Typo fix.

* Oops. Add lein tool.

* infra: Ensure we're in math dir to run lein.

* test: Added test-selectors for running only non-integration tests for math.

* test: Fixed typo in setup-clojure args.

* Upgraded specified java from 1.7 to 1.8.
  • Loading branch information
patcon authored Aug 5, 2020
1 parent 158ffab commit 75f552d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test-clojure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Math/Clojure

on:
push:
branches: ["dev", "504-clj-tests"]
# Note: Only configured for client-admin right now.
paths:
- .github/workflows/test-clojure.yml
- math/**
pull_request:
types: ["opened", "reopened", "synchronize"]
paths:
- .github/workflows/test-clojure.yml
- math/**

jobs:
test-clj:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- uses: actions/[email protected]
with:
java-version: 1.8

- uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: 1.10.1
lein: 2.9.4

- working-directory: math
# Runs all except integration tests which require database and setup/teardown
run: "lein test :default"
11 changes: 8 additions & 3 deletions math/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;:nrepl-middleware [com.gfredericks.debug-repl/wrap-debug-repl]
:port 34344}
:target-path "target/%s"
:javac-target "1.7"
:javac-target "1.8"
:repositories {"twitter4j" "https://twitter4j.org/maven2"}
:plugins [];; need to add profiles to use this to avoid clout dep issue
;[lein-gorilla "0.4.0"]
Expand Down Expand Up @@ -87,5 +87,10 @@
:min-lein-version "2.3.0"
:profiles {:dev {:dependencies []
:source-paths ["src" "dev"]}
:production {:env {}}})

:production {:env {}}}
:test-selectors {:default (fn [m]
(not (or (clojure.string/includes? (str (:ns m)) "conv-man-tests")
(clojure.string/includes? (str (:name m)) "conv-man-tests"))))
:integration (fn [m]
(or (clojure.string/includes? (str (:ns m)) "conv-man-tests")
(clojure.string/includes? (str (:name m)) "conv-man-tests")))})
2 changes: 1 addition & 1 deletion math/system.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java.runtime.version=1.7
java.runtime.version=1.8

0 comments on commit 75f552d

Please sign in to comment.