From 8ed32fa67e9a71e78f5765b1193f7a9e9bcf0942 Mon Sep 17 00:00:00 2001 From: lread Date: Sun, 22 May 2022 14:51:07 -0400 Subject: [PATCH] Switch from lein to clojure tools cli Apologies to any lein lovers out there! Reference to lein either converted to clojure cli or deleted. - Figuring out how to call the official clojure distribution on Windows is an exercise in frustration. Instead we use babashka's clojure function to launch clojure. Works like a charm. - Added new bb task to download clojure deps for CI - Added an anemic pom.xml to preserve data previously held by project.clj. This will be used by release flow once I get to #422. - Unlike lein, the clojure test-runner does not allow selection of tests based on metadata at the namespace level. To easily distinguish unit tests I moved them under a `unit` directory. - I noticed that ide tests were failing for me. This is because we are now testing with our documented minimum Clojure version of 1.9. The ide code was taking advantage of a 1.10 feature. Making it 1.9 compatible was an easy fix. - Switched to logback for logging for dev and testing to avoid any log4j security concern stink. - Noticed that we had `./resources/` `./env/dev/resources` and `./env/test/resources`. But `resources/` contains only test resources, so I moved it under `./env/test/resources`. `./env/dev/resources` seems to be a way to turn on debug logging, so left it as that and created a deps.edn `:debug` alias for it. - Our Makefile is getting smaller. Docker tasks now certainly broken. I'll make a separate issue to deal with this (and move to bb tasks). Helps me with #380 Closes #432 --- .github/workflows/test.yml | 14 ++--- .gitignore | 3 +- CHANGELOG.adoc | 4 ++ Makefile | 33 ++--------- README.adoc | 14 +++-- bb.edn | 1 + deps.edn | 14 +++++ env/dev/resources/log4j.properties | 5 -- env/dev/resources/logback.xml | 19 +++++++ .../resources}/html/drag-n-drop/example.css | 0 .../html/drag-n-drop/example.dart.js | 0 .../html/drag-n-drop/images/README.md | 0 .../html/drag-n-drop/images/document.png | Bin .../html/drag-n-drop/images/trash.png | Bin .../resources}/html/drag-n-drop/index.html | 0 .../test/resources}/html/simple.html | 0 .../test/resources}/html/test.html | 0 .../test/resources}/html/test2.html | 0 .../test/resources}/ide/test.side | 0 .../test/resources}/js/inject.js | 0 env/test/resources/log4j.properties | 5 -- env/test/resources/logback.xml | 19 +++++++ pom.xml | 34 +++++++++++ project.clj | 53 ------------------ script/download_deps.clj | 22 ++++++++ script/helper/shell.clj | 18 ++++-- script/test.clj | 12 ++-- script/tools_versions.clj | 1 - src/etaoin/ide/api.clj | 4 +- src/etaoin/ide/main.clj | 6 +- test/etaoin/api_test.clj | 4 +- test/etaoin/{ => unit}/proc_test.clj | 2 +- test/etaoin/{ => unit}/unit_test.clj | 2 +- test/etaoin/{ => unit}/xpath_test.clj | 2 +- 34 files changed, 163 insertions(+), 128 deletions(-) create mode 100644 deps.edn delete mode 100644 env/dev/resources/log4j.properties create mode 100644 env/dev/resources/logback.xml rename {resources => env/test/resources}/html/drag-n-drop/example.css (100%) rename {resources => env/test/resources}/html/drag-n-drop/example.dart.js (100%) rename {resources => env/test/resources}/html/drag-n-drop/images/README.md (100%) rename {resources => env/test/resources}/html/drag-n-drop/images/document.png (100%) rename {resources => env/test/resources}/html/drag-n-drop/images/trash.png (100%) rename {resources => env/test/resources}/html/drag-n-drop/index.html (100%) rename {resources => env/test/resources}/html/simple.html (100%) rename {resources => env/test/resources}/html/test.html (100%) rename {resources => env/test/resources}/html/test2.html (100%) rename {resources => env/test/resources}/ide/test.side (100%) rename {resources => env/test/resources}/js/inject.js (100%) delete mode 100644 env/test/resources/log4j.properties create mode 100644 env/test/resources/logback.xml create mode 100644 pom.xml delete mode 100644 project.clj create mode 100644 script/download_deps.clj rename test/etaoin/{ => unit}/proc_test.clj (98%) rename test/etaoin/{ => unit}/unit_test.clj (99%) rename test/etaoin/{ => unit}/xpath_test.clj (97%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab88cce9..8f7e5a55 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,8 +22,8 @@ jobs: ~/.m2/repository ~/.deps.clj ~/.gitlibs - key: cljdeps-${{ hashFiles('project.clj, bb.edn') }} - restore-keys: ${{ runner.os }}-cljdeps- + key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} + restore-keys: cljdeps- - name: "Setup Java" uses: actions/setup-java@v3 @@ -35,13 +35,10 @@ jobs: uses: DeLaGuardo/setup-clojure@5.1 with: bb: 'latest' - lein: 'latest' # This assumes downloaded deps are same for all OSes - name: Bring down deps - run: | - lein deps - bb --version + run: bb download-deps - id: set-tests name: Set test var for matrix @@ -69,8 +66,8 @@ jobs: ~/.m2/repository ~/.deps.clj ~/.gitlibs - key: cljdeps-${{ hashFiles('project.clj, bb.edn') }} - restore-keys: ${{ runner.os }}-cljdeps- + key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} + restore-keys: cljdeps- - name: "Setup Java" uses: actions/setup-java@v3 @@ -82,7 +79,6 @@ jobs: uses: DeLaGuardo/setup-clojure@5.1 with: bb: 'latest' - lein: 'latest' - name: Tools versions run: bb tools-versions diff --git a/.gitignore b/.gitignore index c662147b..5f744f06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ /target /classes /checkouts -pom.xml pom.xml.asc *.jar *.class @@ -23,3 +22,5 @@ build.xml .cache # VSCode Calva extension /.calva +# Clojure tools cli classpath cache +/.cpcache diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index ca5b8f71..ae3e94e1 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -23,6 +23,10 @@ Other Changes * https://github.com/clj-commons/etaoin/issues/402[#402]: Only send body for webdriver `POST` requests to appease `safaridriver` * https://github.com/clj-commons/etaoin/issues/403[#403]: The `select` fn now clicks on the `select` element before clicking the `option` element to appease `safaridriver` * https://github.com/clj-commons/etaoin/issues/408[#408]: Fix `switch-window` for `msedgedriver` +* https://github.com/clj-commons/etaoin/issues/432[#432]: Switched from `project.clj` to `deps.edn`. +This will allow for easier testing of unreleased versions of Etaoin via git deps. +It also unconvered that our minimum Clojure version was 1.10, instead of the advertised v1.9. +Fixed. * Docs ** https://github.com/clj-commons/etaoin/issues/393[#393]: Add changelog ** https://github.com/clj-commons/etaoin/issues/396[#396]: Move from Markdown to AsciiDoc diff --git a/Makefile b/Makefile index 669bdf95..5e43bbab 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,4 @@ - -repl: - lein repl - -repl-1.9: - lein with-profile +1.9 repl - -.PHONY: test -test: - lein test - -orig: - find . -name '*.orig' -delete - -.PHONY: tags -tags: - ctags -e -R ./src - -deploy: - lein deploy clojars - -.PHONY: release -release: - lein release +;; TODO: lread move to bb tasks .PHONY: kill kill: @@ -30,9 +7,9 @@ kill: pkill safaridriver || true pkill phantomjs || true - IMAGE := etaoin +;; TODO: lread: have never tried, test, fix if necessary .PHONY: docker-build docker-build: docker build --no-cache -t ${IMAGE}:latest . @@ -43,6 +20,7 @@ check-host: $(error The HOST variable is not set, please do `export HOST=$$HOST` first) endif +;; TODO: lread: have never tried, test, fix if necessary # works only on mac + quartz .PHONY: docker-test-display docker-test-display: check-host @@ -51,12 +29,13 @@ docker-test-display: check-host -v ${CURDIR}:/etaoin \ -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$(HOST):0 \ -w /etaoin ${IMAGE}:latest \ - lein test || \ + bb test all || \ xhost - +;; TODO: lread: have never tried, test, fix if necessary .PHONY: docker-test docker-test: docker run --rm \ -v ${CURDIR}:/etaoin \ -w /etaoin ${IMAGE}:latest \ - lein test + bb test all diff --git a/README.adoc b/README.adoc index 0630bb65..d2592cc6 100644 --- a/README.adoc +++ b/README.adoc @@ -170,7 +170,7 @@ You may run tests for this library by launching: [source,bash] ---- -lein test +bb test all ---- You'll see browser windows open and close in series. @@ -1870,7 +1870,9 @@ Once an error occurs, you will find a PNG image that represents your browser pag Since UI tests may take lots of time to pass, it's definitely a good practice to pass both server and UI tests independently from each other. -First, add `+^:integration+` tag to all the tests that are run inder the browser like follows: +If you are using lneiningen, here are a few tips. + +First, add `+^:integration+` tag to all the tests that are run under the browser like follows: [source,clojure] ---- @@ -1896,7 +1898,7 @@ To run integration tests, launch `lein test :integration`. The main difference between a program and a human is that the first one operates very fast. It means so fast, that sometimes a browser cannot render new HTML in time. So after each action you need to put `wait-` function that just polls a browser checking for a predicate. -O just `(wait )` if you don't care about optimization. +Or just `(wait )` if you don't care about optimization. === Check whether a file has been downloaded @@ -1986,11 +1988,11 @@ Everything related to the IDE is stored under the `etaoin.ide` package. === CLI arguments You may also run a script from the command line. -Here is the `lein run` example: +Here is a `clojure` example: [source,shell] ---- -lein run -m etaoin.ide.main -d firefox -p '{:port 8888 :args ["--no-sandbox"]}' -r ide/test.side +clojure -M -m etaoin.ide.main -d firefox -p '{:port 8888 :args ["--no-sandbox"]}' -r ide/test.side ---- As well as from an uberjar. @@ -2001,7 +2003,7 @@ In this case, Etaoin must be in the primary dependencies, not the `:dev` or `:te java -cp .../poject.jar -m etaoin.ide.main -d firefox -p '{:port 8888}' -f ide/test.side ---- -We support the following arguments (check them out using the `lein run -m etaoin.ide.main -h` command): +We support the following arguments (check them out using the `clojure -M -m etaoin.ide.main -h` command): ---- -d, --driver-name name :chrome The name of driver. The default is `:chrome` diff --git a/bb.edn b/bb.edn index 5f1e25e6..ae5dbf6b 100644 --- a/bb.edn +++ b/bb.edn @@ -11,5 +11,6 @@ :leave (let [{:keys [name]} (current-task)] (status/line :detail "\nTASK %s done." name)) ;; commands + download-deps {:task download-deps/-main :doc "download all deps (useful for CI prep)"} tools-versions {:task tools-versions/-main :doc "report on tools versions"} test {:task test/-main :doc "run all or a subset of tests, use --help for args"}}} diff --git a/deps.edn b/deps.edn new file mode 100644 index 00000000..c92fdd5f --- /dev/null +++ b/deps.edn @@ -0,0 +1,14 @@ +{:paths ["src"] + :deps {org.clojure/clojure {:mvn/version "1.9.0"} ;; min clojure version + babashka/fs {:mvn/version "0.1.6"} + clj-http/clj-http {:mvn/version "3.10.1"} + cheshire/cheshire {:mvn/version "5.9.0"} + org.clojure/tools.cli {:mvn/version "1.0.194"} + org.clojure/tools.logging {:mvn/version "0.3.1"}} + :aliases + {:1.11 {:replace-deps {org.clojure/clojure {:mvn/version "1.11.1"}}} + :debug {:extra-paths ["env/dev/resources"]} + :test {:extra-paths ["test" "env/test/resources"] + :extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"} + ch.qos.logback/logback-classic {:mvn/version "1.3.0-alpha16"}} + :main-opts ["-m" "cognitect.test-runner"]}}} diff --git a/env/dev/resources/log4j.properties b/env/dev/resources/log4j.properties deleted file mode 100644 index 65be0752..00000000 --- a/env/dev/resources/log4j.properties +++ /dev/null @@ -1,5 +0,0 @@ -log4j.rootLogger=INFO, console -log4j.logger.etaoin=DEBUG -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%-5p %c: %m%n diff --git a/env/dev/resources/logback.xml b/env/dev/resources/logback.xml new file mode 100644 index 00000000..049dcec6 --- /dev/null +++ b/env/dev/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + + + %date %-5level %logger{36} - %message%n + + + + + + + + + + + + diff --git a/resources/html/drag-n-drop/example.css b/env/test/resources/html/drag-n-drop/example.css similarity index 100% rename from resources/html/drag-n-drop/example.css rename to env/test/resources/html/drag-n-drop/example.css diff --git a/resources/html/drag-n-drop/example.dart.js b/env/test/resources/html/drag-n-drop/example.dart.js similarity index 100% rename from resources/html/drag-n-drop/example.dart.js rename to env/test/resources/html/drag-n-drop/example.dart.js diff --git a/resources/html/drag-n-drop/images/README.md b/env/test/resources/html/drag-n-drop/images/README.md similarity index 100% rename from resources/html/drag-n-drop/images/README.md rename to env/test/resources/html/drag-n-drop/images/README.md diff --git a/resources/html/drag-n-drop/images/document.png b/env/test/resources/html/drag-n-drop/images/document.png similarity index 100% rename from resources/html/drag-n-drop/images/document.png rename to env/test/resources/html/drag-n-drop/images/document.png diff --git a/resources/html/drag-n-drop/images/trash.png b/env/test/resources/html/drag-n-drop/images/trash.png similarity index 100% rename from resources/html/drag-n-drop/images/trash.png rename to env/test/resources/html/drag-n-drop/images/trash.png diff --git a/resources/html/drag-n-drop/index.html b/env/test/resources/html/drag-n-drop/index.html similarity index 100% rename from resources/html/drag-n-drop/index.html rename to env/test/resources/html/drag-n-drop/index.html diff --git a/resources/html/simple.html b/env/test/resources/html/simple.html similarity index 100% rename from resources/html/simple.html rename to env/test/resources/html/simple.html diff --git a/resources/html/test.html b/env/test/resources/html/test.html similarity index 100% rename from resources/html/test.html rename to env/test/resources/html/test.html diff --git a/resources/html/test2.html b/env/test/resources/html/test2.html similarity index 100% rename from resources/html/test2.html rename to env/test/resources/html/test2.html diff --git a/resources/ide/test.side b/env/test/resources/ide/test.side similarity index 100% rename from resources/ide/test.side rename to env/test/resources/ide/test.side diff --git a/resources/js/inject.js b/env/test/resources/js/inject.js similarity index 100% rename from resources/js/inject.js rename to env/test/resources/js/inject.js diff --git a/env/test/resources/log4j.properties b/env/test/resources/log4j.properties deleted file mode 100644 index f0bc41f4..00000000 --- a/env/test/resources/log4j.properties +++ /dev/null @@ -1,5 +0,0 @@ -log4j.rootLogger=INFO, console -log4j.logger.etaoin=INFO -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%-5p %c: %m%n diff --git a/env/test/resources/logback.xml b/env/test/resources/logback.xml new file mode 100644 index 00000000..980cac66 --- /dev/null +++ b/env/test/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + + + %date %-5level %logger{36} - %message%n + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..42f3f72f --- /dev/null +++ b/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + etaoin + Pure Clojure Webdriver protocol implementation + https://github.com/clj-commons/etaoin + + + Eclipse Public License + http://www.eclipse.org/legal/epl-v10.html + + + + https://github.com/clj-commons/etaoin + scm:git:git://github.com/clj-commons/etaoin.git + scm:git:ssh://git@github.com/clj-commons/etaoin.git + + + UTF-8 + + + + clojars + https://repo.clojars.org/ + + + + + clojars + Clojars repository + https://clojars.org/repo + + + diff --git a/project.clj b/project.clj deleted file mode 100644 index 123aa441..00000000 --- a/project.clj +++ /dev/null @@ -1,53 +0,0 @@ -(defproject etaoin "0.4.7-SNAPSHOT" - - :description "Pure Clojure Webdriver protocol implementation." - - :url "https://github.com/clj-commons/etaoin" - - :license {:name "Eclipse Public License" - :url "http://www.eclipse.org/legal/epl-v10.html"} - - :deploy-repositories {"releases" {:url "https://repo.clojars.org" :creds :gpg}} - - :release-tasks [["vcs" "assert-committed"] - ;; ["shell" "make" "docker-test"] - ["shell" "make" "gh-build"] - ["change" "version" "leiningen.release/bump-version" "release"] - ["vcs" "commit"] - ["vcs" "tag" "--no-sign"] - ["deploy"] - ["change" "version" "leiningen.release/bump-version"] - ["vcs" "commit"] - ["vcs" "push"]] - - :profiles {:dev {:dependencies [[org.clojure/clojure "1.10.1"] - [log4j/log4j "1.2.17"]] - - :resource-paths ["env/dev/resources"] - - :global-vars {*warn-on-reflection* true - *assert* true}} - - :test {:dependencies [[org.clojure/clojure "1.10.1"] - [log4j/log4j "1.2.17"]] - - :resource-paths ["env/test/resources"]} - - :1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}} - - :dependencies [[babashka/fs "0.1.6"] - [clj-http "3.10.1"] - [cheshire "5.9.0"] - [org.clojure/tools.cli "1.0.194"] - [org.clojure/tools.logging "0.3.1"]] - - :test-selectors {:unit :unit} - - ;; - ;; When running the tests as `lein test2junit`, - ;; emit XUNIT test reports to enable CircleCI - ;; to collect statistics over time - ;; - :plugins [[test2junit "1.1.2"] - [lein-shell "0.5.0"]] - :test2junit-output-dir "target/test2junit") diff --git a/script/download_deps.clj b/script/download_deps.clj new file mode 100644 index 00000000..e38c105a --- /dev/null +++ b/script/download_deps.clj @@ -0,0 +1,22 @@ +(ns download-deps + (:require [clojure.edn :as edn] + [helper.main :as main] + [helper.shell :as shell] + [lread.status-line :as status])) + +;; clojure has a -P command, but to bring down all deps we need to specify all aliases +;; bb deps will be brought down just from running bb (which assumedly is how this code is run) + +(defn -main [& args] + (when (main/doc-arg-opt args) + (let [aliases (->> "deps.edn" + slurp + edn/read-string + :aliases + keys)] + ;; one at a time because aliases with :replace-deps will... well... you know. + (status/line :detail "Bring down default deps") + (shell/clojure "-P") + (doseq [a aliases] + (status/line :detail "Bring down deps for alias: %s" a) + (shell/clojure "-P" (str "-M" a)))))) diff --git a/script/helper/shell.clj b/script/helper/shell.clj index da440778..129fb236 100644 --- a/script/helper/shell.clj +++ b/script/helper/shell.clj @@ -7,10 +7,10 @@ (def default-opts {:error-fn (fn die-on-error [{{:keys [exit cmd]} :proc}] - (status/die exit - "shell exited with %d for: %s" - exit - (with-out-str (pprint/pprint cmd))))}) + (status/die exit + "exited with %d for: %s" + exit + (with-out-str (pprint/pprint cmd))))}) (defn command "Thin wrapper on babashka.tasks/shell that on error, prints status error message and exits. @@ -31,3 +31,13 @@ ;; hence the secret exit sauce here (str full-cmd ";exit $LASTEXITCODE") )) (apply tasks/shell opts cmd args)))) + + +(defn clojure + "Wrap tasks/clojure for my loud error reporting treatment" + [& args] + (let [[opts args] (if (map? (first args)) + [(first args) (rest args)] + [nil args]) + opts (merge opts default-opts)] + (apply tasks/clojure opts args))) diff --git a/script/test.clj b/script/test.clj index 53fd5524..0345a0e7 100644 --- a/script/test.clj +++ b/script/test.clj @@ -90,11 +90,11 @@ Notes: (doric/table [:os :cmd :desc])))) :else - (let [lein-args (cond - (get opts "api") "test :only etaoin.api-test" - (get opts "ide") "test :only etaoin.ide-test" - (get opts "unit") "test :unit" - :else "test") + (let [clojure-args (cond + (get opts "api") "-M:test --namespace etaoin.api-test" + (get opts "ide") "-M:test --namespace etaoin.ide-test" + (get opts "unit") "-M:test --namespace-regex '.*unit.*-test$'" + :else "-M:test") browsers (->> (get opts "--browser") (keep identity)) env (cond-> {} (seq browsers) @@ -112,7 +112,7 @@ Notes: (status/line :head "Launching virtual display") (launch-xvfb)) (status/line :head "Running tests") - (shell/command shell-opts (str "lein " lein-args)))))) + (shell/clojure shell-opts clojure-args))))) (main/when-invoked-as-script (apply -main *command-line-args*)) diff --git a/script/tools_versions.clj b/script/tools_versions.clj index 4de683a6..f9540dcb 100644 --- a/script/tools_versions.clj +++ b/script/tools_versions.clj @@ -10,7 +10,6 @@ (def tools [;; earlier versions of java used -version and spit version info to stderr {:oses :all :name "Java" :type :bin :app "java" :args "-version" :shell-opts {:out :string :err :string :continue true}} - {:oses :all :name "Leiningen" :type :bin :app "lein"} {:oses :all :name "Babashka" :type :bin :app "bb"} {:oses [:unix] :name "Chrome" :type :bin :app "google-chrome"} ;; only handling nix for now diff --git a/src/etaoin/ide/api.clj b/src/etaoin/ide/api.clj index 6eca2856..242a4884 100644 --- a/src/etaoin/ide/api.clj +++ b/src/etaoin/ide/api.clj @@ -720,9 +720,9 @@ (let [[msg result] (try ["OK" (run-command driver command opt)] (catch Exception e - [(format "Failed: %s" (ex-message e)) e]) + [(format "Failed: %s" (.getMessage e)) e]) (catch java.lang.AssertionError e - [(format "Failed: %s" (ex-message e)) e])) + [(format "Failed: %s" (.getMessage e)) e])) message (str (log-command-message command) " / " msg)] (log/info message) diff --git a/src/etaoin/ide/main.clj b/src/etaoin/ide/main.clj index b25e81e5..d9c7e2df 100644 --- a/src/etaoin/ide/main.clj +++ b/src/etaoin/ide/main.clj @@ -3,7 +3,7 @@ Provide an CLI entry point for running IDE files. Example: - lein run -m etaoin.ide.main -d firefox -p '{:port 8888 :args [\"--no-sandbox\"]}' -f /path/to/script.side + clojure -M -m etaoin.ide.main -d firefox -p '{:port 8888 :args [\"--no-sandbox\"]}' -f /path/to/script.side See the readme file for more info. " @@ -64,8 +64,8 @@ This is a CLI interface for running Selenium IDE files. Usage examples: -;; from lein -lein run -m etaoin.ide.main -d firefox -p '{:port 8888 :args [\"--no-sandbox\"]}' -r ide/test.side +;; from clojure +clojure -M -m etaoin.ide.main -d firefox -p '{:port 8888 :args [\"--no-sandbox\"]}' -r ide/test.side ;; from a jar java -cp .../poject.jar -m etaoin.ide.main -d firefox -p '{:port 8888}' -f ide/test.side diff --git a/test/etaoin/api_test.clj b/test/etaoin/api_test.clj index 1c42984b..a1ce4431 100644 --- a/test/etaoin/api_test.clj +++ b/test/etaoin/api_test.clj @@ -16,9 +16,7 @@ ;; By default we run the tests with all the drivers supported on the current OS. ;; To override this, you can set the environment variable ETAOIN_TEST_DRIVERS -;; to a Clojure vector encoded as a string; for example: -;; -;; ETAOIN_TEST_DRIVERS="[:firefox]" lein test +;; to a Clojure vector encoded as a string; see script/test.clj for how we use this. (defn get-drivers-from-env [] (when-let [override (System/getenv "ETAOIN_TEST_DRIVERS")] diff --git a/test/etaoin/proc_test.clj b/test/etaoin/unit/proc_test.clj similarity index 98% rename from test/etaoin/proc_test.clj rename to test/etaoin/unit/proc_test.clj index 34c2ba35..6e33dab6 100644 --- a/test/etaoin/proc_test.clj +++ b/test/etaoin/unit/proc_test.clj @@ -1,4 +1,4 @@ -(ns ^:unit etaoin.proc-test +(ns etaoin.unit.proc-test (:require [etaoin.api :refer :all] [clojure.java.shell :refer [sh]] [clojure.test :refer :all] diff --git a/test/etaoin/unit_test.clj b/test/etaoin/unit/unit_test.clj similarity index 99% rename from test/etaoin/unit_test.clj rename to test/etaoin/unit/unit_test.clj index fc2cab05..3bde9a74 100644 --- a/test/etaoin/unit_test.clj +++ b/test/etaoin/unit/unit_test.clj @@ -1,4 +1,4 @@ -(ns ^:unit etaoin.unit-test +(ns etaoin.unit.unit-test (:require [clojure.spec.alpha :as s] [clojure.test :refer :all] [etaoin.api :refer :all] diff --git a/test/etaoin/xpath_test.clj b/test/etaoin/unit/xpath_test.clj similarity index 97% rename from test/etaoin/xpath_test.clj rename to test/etaoin/unit/xpath_test.clj index 55344946..d7c6cfa1 100644 --- a/test/etaoin/xpath_test.clj +++ b/test/etaoin/unit/xpath_test.clj @@ -1,4 +1,4 @@ -(ns ^:unit etaoin.xpath-test +(ns etaoin.unit.xpath-test (:require [clojure.test :refer :all] [etaoin.test-report] [etaoin.xpath :as xpath]))