Comments (6)
Hey @didibus, thanks for taking the time to suggest this. It is always great to hear from a user of test-refresh.
What test-runner are you using?
My current thinking is this is a feature that probably won't get added and then supported forever since a similar goal can be achieve with the current implementation of test selectors.
Any reason why you don't use those?
from test-refresh.
Maybe I'm missing something about the test-selectors, but I thought they required you to add meta to your functions?
My build system test-runner uses filenames to distinguish integ from unit tests. So I need my lein setup to be the same. Is that achievable with test-selectors?
from test-refresh.
It is!
The test-selectors get the metadata map for the deftest
. This includes a :name
key that points towards the test symbol. Below is an example that would only run tests for symbols that contain "integration"
:test-selectors {:integration (fn [m]
(clojure.string/includes? (str (:name m))
"integration"))}
from test-refresh.
Let me know if something like that doesn't work out for you. If it doesn't, I'd be interested in digging deeper.
from test-refresh.
Below is a combination of selectors that would cause the default case to not run integration tests. It also adds looking at the namespace.
:test-selectors {:default (fn [m]
(not (or (clojure.string/includes? (str (:ns m)) "integration")
(clojure.string/includes? (str (:name m)) "integration"))))
:integration (fn [m]
(or (clojure.string/includes? (str (:ns m)) "integration")
(clojure.string/includes? (str (:name m)) "integration")))}
from test-refresh.
Wrote up a blog post talking about this
from test-refresh.
Related Issues (20)
- run-once should exit with non-zero if there were test failures HOT 1
- Need to respect :source-paths and :test-paths from project.clj HOT 1
- Clearing screen before each test run HOT 3
- test-refresh fails to start when project.clj has managed dependencies HOT 3
- Specs are not reloaded when run through compojure-api HOT 2
- Readme: Add an example of how to integrate with ultra or eftest HOT 6
- Feature request: circleci.test support HOT 3
- Issue with test refresh and clojure 1.9 with spec HOT 1
- test-refresh loads configuration for dev profile while running after a repl is started HOT 3
- Tests are run multiple times on file change when using a docker volume on OSX HOT 1
- Launch nrepl server along with the test runner HOT 2
- Allow using custom keyword instead of :test-refresh/focus HOT 2
- Running in Cursive REPL HOT 4
- ^:test-refresh/focus selector doesn't work in 0.24.0 HOT 2
- Problem with defonce and URLStreamHandlerFactory HOT 4
- Is it possible to place test files and source files under a single root directory? HOT 2
- `:quiet` flag is broken HOT 2
- `:quiet` flag is ignored under `deps/cli` HOT 4
- Feature Request: write out .lein-failures each loop so you can inspect current failures from a file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-refresh.