diff --git a/.circleci/config.yml b/.circleci/config.yml index f044e1780..4d219ba91 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,19 +62,19 @@ jobs: name: common tests command: | yarn install - yarn run compile-test - node target/test.js - clojure -X:dev:test :patterns '["common-tests.test-.*"]' + yarn test + clojure -X:dev:test :patterns '["common-tests.*-test"]' environment: PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin JVM_OPTS: -Xmx4g + NODE_OPTIONS: --max-old-space-size=4096 - run: name: backend test working_directory: "./backend" command: | - clojure -X:dev:test :patterns '["app-tests.test-.*"]' + clojure -X:dev:test :patterns '["backend-tests.*-test"]' environment: PENPOT_TEST_DATABASE_URI: "postgresql://localhost/penpot_test" @@ -88,11 +88,11 @@ jobs: working_directory: "./frontend" command: | yarn install - clojure -M:dev:shadow-cljs compile test - node target/tests.js + yarn test environment: PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin + NODE_OPTIONS: --max-old-space-size=4096 - save_cache: paths: diff --git a/backend/dev/user.clj b/backend/dev/user.clj index a0cff0275..dce35764b 100644 --- a/backend/dev/user.clj +++ b/backend/dev/user.clj @@ -63,7 +63,7 @@ ;; --- Development Stuff (defn- run-tests - ([] (run-tests #"^backend-tests.test-.*$")) + ([] (run-tests #"^backend-tests.*-test$")) ([o] (repl/refresh) (cond diff --git a/backend/test/backend_tests/test_bounce_handling.clj b/backend/test/backend_tests/bounce_handling_test.clj similarity index 99% rename from backend/test/backend_tests/test_bounce_handling.clj rename to backend/test/backend_tests/bounce_handling_test.clj index a85616ffe..2938ecc9f 100644 --- a/backend/test/backend_tests/test_bounce_handling.clj +++ b/backend/test/backend_tests/bounce_handling_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-bounce-handling +(ns backend-tests.bounce-handling-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.db :as db] [app.emails :as emails] [app.http.awsns :as awsns] diff --git a/backend/test/backend_tests/test_email_sending.clj b/backend/test/backend_tests/email_sending_test.clj similarity index 90% rename from backend/test/backend_tests/test_email_sending.clj rename to backend/test/backend_tests/email_sending_test.clj index 685d65779..49802dd9e 100644 --- a/backend/test/backend_tests/test_email_sending.clj +++ b/backend/test/backend_tests/email_sending_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-email-sending +(ns backend-tests.email-sending-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.db :as db] [app.emails :as emails] [clojure.test :as t] diff --git a/backend/test/backend_tests/test_helpers.clj b/backend/test/backend_tests/helpers.clj similarity index 99% rename from backend/test/backend_tests/test_helpers.clj rename to backend/test/backend_tests/helpers.clj index 01948bcb9..75b3a3eb8 100644 --- a/backend/test/backend_tests/test_helpers.clj +++ b/backend/test/backend_tests/helpers.clj @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-helpers +(ns backend-tests.helpers (:require [app.common.data :as d] [app.common.flags :as flags] @@ -65,7 +65,7 @@ :name "test" :file-uri "test" :thumbnail-uri "test" - :path (-> "app_tests/test_files/template.penpot" io/resource fs/path)}] + :path (-> "backend_tests/test_files/template.penpot" io/resource fs/path)}] system (-> (merge main/system-config main/worker-config) (assoc-in [:app.redis/redis :uri] (:redis-uri config)) (assoc-in [:app.db/pool :uri] (:database-uri config)) diff --git a/backend/test/backend_tests/test_rpc_file.clj b/backend/test/backend_tests/rpc_file_test.clj similarity index 99% rename from backend/test/backend_tests/test_rpc_file.clj rename to backend/test/backend_tests/rpc_file_test.clj index 15fc74fc8..6f7562b54 100644 --- a/backend/test/backend_tests/test_rpc_file.clj +++ b/backend/test/backend_tests/rpc_file_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-file +(ns backend-tests.rpc-file-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [app.db.sql :as sql] @@ -124,7 +124,7 @@ (t/deftest file-gc-task (letfn [(create-file-media-object [{:keys [profile-id file-id]}] (let [mfile {:filename "sample.jpg" - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg" :size 312043} params {::th/type :upload-file-media-object diff --git a/backend/test/backend_tests/test_rpc_font.clj b/backend/test/backend_tests/rpc_font_test.clj similarity index 92% rename from backend/test/backend_tests/test_rpc_font.clj rename to backend/test/backend_tests/rpc_font_test.clj index f6c6c75d2..6116b8d8a 100644 --- a/backend/test/backend_tests/test_rpc_font.clj +++ b/backend/test/backend_tests/rpc_font_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-font +(ns backend-tests.rpc-font-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [app.http :as http] @@ -24,7 +24,7 @@ proj-id (:default-project-id prof) font-id (uuid/custom 10 1) - ttfdata (-> (io/resource "app_tests/test_files/font-1.ttf") + ttfdata (-> (io/resource "backend_tests/test_files/font-1.ttf") io/input-stream io/read-as-bytes) @@ -59,7 +59,7 @@ proj-id (:default-project-id prof) font-id (uuid/custom 10 1) - data (-> (io/resource "app_tests/test_files/font-1.woff") + data (-> (io/resource "backend_tests/test_files/font-1.woff") io/input-stream io/read-as-bytes) diff --git a/backend/test/backend_tests/test_rpc_management.clj b/backend/test/backend_tests/rpc_management_test.clj similarity index 99% rename from backend/test/backend_tests/test_rpc_management.clj rename to backend/test/backend_tests/rpc_management_test.clj index 9c68bd94c..c1f03838d 100644 --- a/backend/test/backend_tests/test_rpc_management.clj +++ b/backend/test/backend_tests/rpc_management_test.clj @@ -4,10 +4,10 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-management +(ns backend-tests.rpc-management-test (:require - [backend-tests.test-storage :refer [configure-storage-backend]] - [backend-tests.test-helpers :as th] + [backend-tests.storage-test :refer [configure-storage-backend]] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [app.http :as http] diff --git a/backend/test/backend_tests/test_rpc_media.clj b/backend/test/backend_tests/rpc_media_test.clj similarity index 96% rename from backend/test/backend_tests/test_rpc_media.clj rename to backend/test/backend_tests/rpc_media_test.clj index dbe3fe68e..5fb6f9905 100644 --- a/backend/test/backend_tests/test_rpc_media.clj +++ b/backend/test/backend_tests/rpc_media_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-media +(ns backend-tests.rpc-media-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [app.storage :as sto] @@ -60,7 +60,7 @@ :project-id (:default-project-id prof) :is-shared false}) mfile {:filename "sample.jpg" - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg" :size 312043} @@ -99,7 +99,7 @@ :project-id (:default-project-id prof) :is-shared false}) mfile {:filename "sample.jpg" - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg" :size 312043} diff --git a/backend/test/backend_tests/test_rpc_profile.clj b/backend/test/backend_tests/rpc_profile_test.clj similarity index 99% rename from backend/test/backend_tests/test_rpc_profile.clj rename to backend/test/backend_tests/rpc_profile_test.clj index 8e8902992..1c97a904b 100644 --- a/backend/test/backend_tests/test_rpc_profile.clj +++ b/backend/test/backend_tests/rpc_profile_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-profile +(ns backend-tests.rpc-profile-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.config :as cf] [app.db :as db] @@ -110,7 +110,7 @@ :profile-id (:id profile) :file {:filename "sample.jpg" :size 123123 - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg"}} out (th/mutation! data)] diff --git a/backend/test/backend_tests/test_rpc_project.clj b/backend/test/backend_tests/rpc_project_test.clj similarity index 99% rename from backend/test/backend_tests/test_rpc_project.clj rename to backend/test/backend_tests/rpc_project_test.clj index a8e4286d8..24c745a83 100644 --- a/backend/test/backend_tests/test_rpc_project.clj +++ b/backend/test/backend_tests/rpc_project_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-project +(ns backend-tests.rpc-project-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [app.http :as http] diff --git a/backend/test/backend_tests/test_rpc_team.clj b/backend/test/backend_tests/rpc_team_test.clj similarity index 99% rename from backend/test/backend_tests/test_rpc_team.clj rename to backend/test/backend_tests/rpc_team_test.clj index 23dedbe88..302f80dc5 100644 --- a/backend/test/backend_tests/test_rpc_team.clj +++ b/backend/test/backend_tests/rpc_team_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-team +(ns backend-tests.rpc-team-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [app.http :as http] diff --git a/backend/test/backend_tests/test_rpc_viewer.clj b/backend/test/backend_tests/rpc_viewer_test.clj similarity index 98% rename from backend/test/backend_tests/test_rpc_viewer.clj rename to backend/test/backend_tests/rpc_viewer_test.clj index e09ba7846..baaa416ed 100644 --- a/backend/test/backend_tests/test_rpc_viewer.clj +++ b/backend/test/backend_tests/rpc_viewer_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-rpc-viewer +(ns backend-tests.rpc-viewer-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.uuid :as uuid] [app.db :as db] [clojure.test :as t] diff --git a/backend/test/backend_tests/test_storage.clj b/backend/test/backend_tests/storage_test.clj similarity index 97% rename from backend/test/backend_tests/test_storage.clj rename to backend/test/backend_tests/storage_test.clj index af5cd7f62..b47e98b09 100644 --- a/backend/test/backend_tests/test_storage.clj +++ b/backend/test/backend_tests/storage_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-storage +(ns backend-tests.storage-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.exceptions :as ex] [app.common.uuid :as uuid] [app.db :as db] @@ -126,7 +126,7 @@ :is-shared false}) mfile {:filename "sample.jpg" - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg" :size 312043} @@ -196,12 +196,12 @@ :project-id proj-id :is-shared false}) - ttfdata (-> (io/resource "app_tests/test_files/font-1.ttf") + ttfdata (-> (io/resource "backend_tests/test_files/font-1.ttf") io/input-stream io/read-as-bytes) mfile {:filename "sample.jpg" - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg" :size 312043} @@ -267,7 +267,7 @@ :project-id (:default-project-id prof) :is-shared false}) mfile {:filename "sample.jpg" - :path (th/tempfile "app_tests/test_files/sample.jpg") + :path (th/tempfile "backend_tests/test_files/sample.jpg") :mtype "image/jpeg" :size 312043} diff --git a/backend/test/backend_tests/test_telemetry_task.clj b/backend/test/backend_tests/tasks_telemetry_test.clj similarity index 96% rename from backend/test/backend_tests/test_telemetry_task.clj rename to backend/test/backend_tests/tasks_telemetry_test.clj index f1b177467..7ff727b8b 100644 --- a/backend/test/backend_tests/test_telemetry_task.clj +++ b/backend/test/backend_tests/tasks_telemetry_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-telemetry-task +(ns backend-tests.tasks-telemetry-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.db :as db] [app.emails :as emails] [app.util.time :as dt] diff --git a/backend/test/backend_tests/test_files/template.penpot b/backend/test/backend_tests/test_files/template.penpot new file mode 100644 index 000000000..e0c81bb83 Binary files /dev/null and b/backend/test/backend_tests/test_files/template.penpot differ diff --git a/backend/test/backend_tests/test_util_objects_map.clj b/backend/test/backend_tests/util_objects_map_test.clj similarity index 98% rename from backend/test/backend_tests/test_util_objects_map.clj rename to backend/test/backend_tests/util_objects_map_test.clj index 7253e82ae..d9fa1b3d0 100644 --- a/backend/test/backend_tests/test_util_objects_map.clj +++ b/backend/test/backend_tests/util_objects_map_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-util-objects-map +(ns backend-tests.util-objects-map-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.spec :as us] [app.common.transit :as transit] [app.common.types.shape :as cts] diff --git a/backend/test/backend_tests/test_util_pointer_map.clj b/backend/test/backend_tests/util_pointer_map_test.clj similarity index 98% rename from backend/test/backend_tests/test_util_pointer_map.clj rename to backend/test/backend_tests/util_pointer_map_test.clj index 7d3638a1b..f496a5738 100644 --- a/backend/test/backend_tests/test_util_pointer_map.clj +++ b/backend/test/backend_tests/util_pointer_map_test.clj @@ -4,9 +4,9 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns backend-tests.test-util-pointer-map +(ns backend-tests.util-pointer-map-test (:require - [backend-tests.test-helpers :as th] + [backend-tests.helpers :as th] [app.common.spec :as us] [app.common.transit :as transit] [app.common.types.shape :as cts] diff --git a/common/shadow-cljs.edn b/common/shadow-cljs.edn index bca945b8e..a06131055 100644 --- a/common/shadow-cljs.edn +++ b/common/shadow-cljs.edn @@ -8,7 +8,7 @@ {:target :node-test :output-to "target/test.js" :output-dir "target/test/" - :ns-regexp "^common-tests.test-.*$" + :ns-regexp "^common-tests.*-test$" :autorun true :compiler-options diff --git a/common/test/common_tests/test_data.cljc b/common/test/common_tests/data_test.cljc similarity index 98% rename from common/test/common_tests/test_data.cljc rename to common/test/common_tests/data_test.cljc index 85b942f74..5fd35b920 100644 --- a/common/test/common_tests/test_data.cljc +++ b/common/test/common_tests/data_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-data +(ns common-tests.data-test (:require [app.common.data :as d] [clojure.test :as t])) diff --git a/common/test/common_tests/test_geom_shapes.cljc b/common/test/common_tests/geom_shapes_test.cljc similarity index 99% rename from common/test/common_tests/test_geom_shapes.cljc rename to common/test/common_tests/geom_shapes_test.cljc index 1358be6ac..f86487de2 100644 --- a/common/test/common_tests/test_geom_shapes.cljc +++ b/common/test/common_tests/geom_shapes_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-geom-shapes +(ns common-tests.geom-shapes-test (:require [app.common.geom.matrix :as gmt] [app.common.geom.point :as gpt] diff --git a/common/test/common_tests/test_geom.cljc b/common/test/common_tests/geom_test.cljc similarity index 99% rename from common/test/common_tests/test_geom.cljc rename to common/test/common_tests/geom_test.cljc index 46786c54d..36d99267d 100644 --- a/common/test/common_tests/test_geom.cljc +++ b/common/test/common_tests/geom_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-geom +(ns common-tests.geom-test (:require [clojure.test :as t] [app.common.math :as mth] diff --git a/common/test/common_tests/test_helpers/components.cljc b/common/test/common_tests/helpers/components.cljc similarity index 99% rename from common/test/common_tests/test_helpers/components.cljc rename to common/test/common_tests/helpers/components.cljc index f459ae005..b96e0fea6 100644 --- a/common/test/common_tests/test_helpers/components.cljc +++ b/common/test/common_tests/helpers/components.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-helpers.components +(ns common-tests.helpers.components (:require [clojure.test :as t] [app.common.pages.helpers :as cph] diff --git a/common/test/common_tests/test_helpers/files.cljc b/common/test/common_tests/helpers/files.cljc similarity index 99% rename from common/test/common_tests/test_helpers/files.cljc rename to common/test/common_tests/helpers/files.cljc index 69a51bbfa..694505139 100644 --- a/common/test/common_tests/test_helpers/files.cljc +++ b/common/test/common_tests/helpers/files.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-helpers.files +(ns common-tests.helpers.files (:require [app.common.files.features :as ffeat] [app.common.geom.point :as gpt] diff --git a/common/test/common_tests/test_pages_helpers.cljc b/common/test/common_tests/pages_helpers_test.cljc similarity index 97% rename from common/test/common_tests/test_pages_helpers.cljc rename to common/test/common_tests/pages_helpers_test.cljc index 50b87c813..6079b0b84 100644 --- a/common/test/common_tests/test_pages_helpers.cljc +++ b/common/test/common_tests/pages_helpers_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-pages-helpers +(ns common-tests.pages-helpers-test (:require [clojure.test :as t] [clojure.pprint :refer [pprint]] diff --git a/common/test/common_tests/test_pages_migrations.cljc b/common/test/common_tests/pages_migrations_test.cljc similarity index 98% rename from common/test/common_tests/test_pages_migrations.cljc rename to common/test/common_tests/pages_migrations_test.cljc index 75d593665..e3a1a58f0 100644 --- a/common/test/common_tests/test_pages_migrations.cljc +++ b/common/test/common_tests/pages_migrations_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-pages-migrations +(ns common-tests.pages-migrations-test (:require [clojure.test :as t] [clojure.pprint :refer [pprint]] diff --git a/common/test/common_tests/test_pages.cljc b/common/test/common_tests/pages_test.cljc similarity index 99% rename from common/test/common_tests/test_pages.cljc rename to common/test/common_tests/pages_test.cljc index aa50164b7..f90cccf77 100644 --- a/common/test/common_tests/test_pages.cljc +++ b/common/test/common_tests/pages_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-pages +(ns common-tests.pages-test (:require [app.common.files.features :as ffeat] [app.common.pages :as cp] diff --git a/frontend/test/app/init_test.cljs b/common/test/common_tests/setup.cljs similarity index 73% rename from frontend/test/app/init_test.cljs rename to common/test/common_tests/setup.cljs index 0e36cdcd0..60b1e5ac1 100644 --- a/frontend/test/app/init_test.cljs +++ b/common/test/common_tests/setup.cljs @@ -1,6 +1,6 @@ -(ns app.init-test +(ns common-tests.setup (:require - [cljs.test :as t :include-macros true])) + [clojure.test :as t])) (defmethod t/report [:cljs.test/default :end-run-tests] [m] diff --git a/common/test/common_tests/test_setup.cljc b/common/test/common_tests/test_setup.cljc deleted file mode 100644 index 8dc2e87d8..000000000 --- a/common/test/common_tests/test_setup.cljc +++ /dev/null @@ -1,10 +0,0 @@ -(ns common-tests.test-setup - (:require - [clojure.test :as t])) - -#?(:cljs - (defmethod t/report [:cljs.test/default :end-run-tests] - [m] - (if (t/successful? m) - (set! (.-exitCode js/process) 0) - (set! (.-exitCode js/process) 1)))) diff --git a/common/test/common_tests/test_text.cljc b/common/test/common_tests/text_test.cljc similarity index 97% rename from common/test/common_tests/test_text.cljc rename to common/test/common_tests/text_test.cljc index a6bd1c47e..3c9fb6935 100644 --- a/common/test/common_tests/test_text.cljc +++ b/common/test/common_tests/text_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-text +(ns common-tests.text-test (:require [app.common.data :as d] [app.common.text :as txt] diff --git a/common/test/common_tests/test_types_file.cljc b/common/test/common_tests/types_file_test.cljc similarity index 98% rename from common/test/common_tests/test_types_file.cljc rename to common/test/common_tests/types_file_test.cljc index a5e0017ab..d4af3db5b 100644 --- a/common/test/common_tests/test_types_file.cljc +++ b/common/test/common_tests/types_file_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-types-file +(ns common-tests.types-file-test (:require [app.common.data :as d] [app.common.geom.point :as gpt] @@ -21,8 +21,8 @@ [app.common.uuid :as uuid] [clojure.pprint :refer [pprint]] [clojure.test :as t] - [common-tests.test-helpers.components :as thk] - [common-tests.test-helpers.files :as thf] + [common-tests.helpers.components :as thk] + [common-tests.helpers.files :as thf] [cuerdas.core :as str])) (t/use-fixtures :each thf/reset-idmap!) diff --git a/common/test/common_tests/test_types_shape_interactions.cljc b/common/test/common_tests/types_shape_interactions_test.cljc similarity index 99% rename from common/test/common_tests/test_types_shape_interactions.cljc rename to common/test/common_tests/types_shape_interactions_test.cljc index b92f6c725..da5340dd1 100644 --- a/common/test/common_tests/test_types_shape_interactions.cljc +++ b/common/test/common_tests/types_shape_interactions_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-types-shape-interactions +(ns common-tests.types-shape-interactions-test (:require [app.common.exceptions :as ex] [app.common.geom.point :as gpt] diff --git a/common/test/common_tests/test_types.cljc b/common/test/common_tests/types_test.cljc similarity index 98% rename from common/test/common_tests/test_types.cljc rename to common/test/common_tests/types_test.cljc index f64828d3a..99dec9343 100644 --- a/common/test/common_tests/test_types.cljc +++ b/common/test/common_tests/types_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-types +(ns common-tests.types-test (:require [clojure.spec.alpha :as s] [clojure.test :as t] diff --git a/common/test/common_tests/test_uuid.cljc b/common/test/common_tests/uuid_test.cljc similarity index 96% rename from common/test/common_tests/test_uuid.cljc rename to common/test/common_tests/uuid_test.cljc index f57c84914..e52b1f2e8 100644 --- a/common/test/common_tests/test_uuid.cljc +++ b/common/test/common_tests/uuid_test.cljc @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns common-tests.test-uuid +(ns common-tests.uuid-test (:require [app.common.spec :as us] [app.common.uuid :as uuid] diff --git a/frontend/shadow-cljs.edn b/frontend/shadow-cljs.edn index b532672e9..dd5285eac 100644 --- a/frontend/shadow-cljs.edn +++ b/frontend/shadow-cljs.edn @@ -86,7 +86,7 @@ {:target :node-test :output-to "target/tests.js" :output-dir "target/test/" - :ns-regexp "^app.*-test$" + :ns-regexp "^frontend-tests.*-test$" :autorun true :compiler-options diff --git a/frontend/test/app/test_helpers/events.cljs b/frontend/test/frontend_tests/helpers/events.cljs similarity index 87% rename from frontend/test/app/test_helpers/events.cljs rename to frontend/test/frontend_tests/helpers/events.cljs index 82857a30e..e398e0420 100644 --- a/frontend/test/app/test_helpers/events.cljs +++ b/frontend/test/frontend_tests/helpers/events.cljs @@ -1,14 +1,20 @@ -(ns app.test-helpers.events +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.helpers.events (:require - [app.common.uuid :as uuid] [app.common.geom.point :as gpt] [app.common.geom.shapes :as gsh] [app.common.pages :as cp] [app.common.pages.helpers :as cph] + [app.common.uuid :as uuid] [app.main.data.workspace :as dw] - [cljs.test :as t :include-macros true] - [cljs.pprint :refer [pprint]] [beicon.core :as rx] + [cljs.pprint :refer [pprint]] + [cljs.test :as t :include-macros true] [potok.core :as ptk])) ;; ---- Helpers to manage global events diff --git a/frontend/test/app/test_helpers/libraries.cljs b/frontend/test/frontend_tests/helpers/libraries.cljs similarity index 93% rename from frontend/test/app/test_helpers/libraries.cljs rename to frontend/test/frontend_tests/helpers/libraries.cljs index 8a2a2b8fe..c00776136 100644 --- a/frontend/test/app/test_helpers/libraries.cljs +++ b/frontend/test/frontend_tests/helpers/libraries.cljs @@ -1,12 +1,18 @@ -(ns app.test-helpers.libraries +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.helpers.libraries (:require - [cljs.test :as t :include-macros true] - [cljs.pprint :refer [pprint]] [app.common.pages.helpers :as cph] [app.common.types.component :as ctk] [app.common.types.container :as ctn] [app.main.data.workspace.state-helpers :as wsh] - [app.test-helpers.pages :as thp])) + [cljs.pprint :refer [pprint]] + [cljs.test :as t :include-macros true] + [frontend-tests.helpers.pages :as thp])) ;; ---- Helpers to manage libraries and synchronization @@ -150,7 +156,7 @@ [shapes-inst shapes-main component])) (defn resolve-component - "Get the component with the given id and all its shapes." + "Get the component with the given id and all its shapes." [state component-id] (let [page (thp/current-page state) libs (wsh/get-libraries state) diff --git a/frontend/test/app/test_helpers/pages.cljs b/frontend/test/frontend_tests/helpers/pages.cljs similarity index 93% rename from frontend/test/app/test_helpers/pages.cljs rename to frontend/test/frontend_tests/helpers/pages.cljs index e66974d01..34e4994d2 100644 --- a/frontend/test/app/test_helpers/pages.cljs +++ b/frontend/test/frontend_tests/helpers/pages.cljs @@ -1,20 +1,26 @@ -(ns app.test-helpers.pages +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.helpers.pages (:require - [cljs.test :as t :include-macros true] - [cljs.pprint :refer [pprint]] - [beicon.core :as rx] - [potok.core :as ptk] - [app.common.uuid :as uuid] [app.common.geom.point :as gpt] [app.common.geom.shapes :as gsh] [app.common.pages :as cp] [app.common.pages.helpers :as cph] [app.common.types.shape :as cts] + [app.common.uuid :as uuid] [app.main.data.workspace :as dw] [app.main.data.workspace.groups :as dwg] [app.main.data.workspace.layout :as layout] [app.main.data.workspace.libraries-helpers :as dwlh] - [app.main.data.workspace.state-helpers :as wsh])) + [app.main.data.workspace.state-helpers :as wsh] + [beicon.core :as rx] + [cljs.pprint :refer [pprint]] + [cljs.test :as t :include-macros true] + [potok.core :as ptk])) ;; ---- Helpers to manage pages and objects diff --git a/frontend/test/app/shapes_test.cljs b/frontend/test/frontend_tests/helpers_shapes_test.cljs similarity index 77% rename from frontend/test/app/shapes_test.cljs rename to frontend/test/frontend_tests/helpers_shapes_test.cljs index cb3564c07..aec0f6a0f 100644 --- a/frontend/test/app/shapes_test.cljs +++ b/frontend/test/frontend_tests/helpers_shapes_test.cljs @@ -1,17 +1,23 @@ -(ns app.shapes-test +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.helpers-shapes-test (:require [app.common.colors :as clr] [app.common.data :as d] [app.common.geom.point :as gpt] [app.common.pages.helpers :as cph] [app.main.data.workspace.libraries :as dwl] - [app.test-helpers.events :as the] - [app.test-helpers.libraries :as thl] - [app.test-helpers.pages :as thp] [beicon.core :as rx] [cljs.pprint :refer [pprint]] [cljs.test :as t :include-macros true] [clojure.stacktrace :as stk] + [frontend-tests.helpers.events :as the] + [frontend-tests.helpers.libraries :as thl] + [frontend-tests.helpers.pages :as thp] [linked.core :as lks] [potok.core :as ptk])) diff --git a/frontend/test/frontend_tests/setup.cljs b/frontend/test/frontend_tests/setup.cljs new file mode 100644 index 000000000..8ab8d8a80 --- /dev/null +++ b/frontend/test/frontend_tests/setup.cljs @@ -0,0 +1,22 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.setup + (:require + [cljs.test :as t :include-macros true])) + +#_(enable-console-print!) + +(defmethod t/report [:cljs.test/default :end-run-tests] + [m] + (if (t/successful? m) + (set! (.-exitCode js/process) 0) + (set! (.-exitCode js/process) 1))) + +#_(set! *main-cli-fn* + #(t/run-tests 'frontend-tests.test-snap-data + 'frontend-tests.test-simple-math + 'frontend-tests.test-range-tree)) diff --git a/frontend/test/app/components_sync_test.cljs b/frontend/test/frontend_tests/state_components_sync_test.cljs similarity index 99% rename from frontend/test/app/components_sync_test.cljs rename to frontend/test/frontend_tests/state_components_sync_test.cljs index 05bf78ea2..d6c94ce01 100644 --- a/frontend/test/app/components_sync_test.cljs +++ b/frontend/test/frontend_tests/state_components_sync_test.cljs @@ -1,4 +1,10 @@ -(ns app.components-sync-test +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.state-components-sync-test (:require [app.common.colors :as clr] [app.common.data :as d] @@ -7,16 +13,16 @@ [app.common.types.container :as ctn] [app.main.data.workspace :as dw] [app.main.data.workspace.changes :as dch] - [app.main.data.workspace.shapes :as dwsh] [app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.libraries-helpers :as dwlh] + [app.main.data.workspace.shapes :as dwsh] [app.main.data.workspace.state-helpers :as wsh] - [app.test-helpers.events :as the] - [app.test-helpers.libraries :as thl] - [app.test-helpers.pages :as thp] [beicon.core :as rx] [cljs.pprint :refer [pprint]] [cljs.test :as t :include-macros true] + [frontend-tests.helpers.events :as the] + [frontend-tests.helpers.libraries :as thl] + [frontend-tests.helpers.pages :as thp] [linked.core :as lks] [potok.core :as ptk])) diff --git a/frontend/test/app/components_basic_test.cljs b/frontend/test/frontend_tests/state_components_test.cljs similarity index 99% rename from frontend/test/app/components_basic_test.cljs rename to frontend/test/frontend_tests/state_components_test.cljs index f419b9646..86a4a56d6 100644 --- a/frontend/test/app/components_basic_test.cljs +++ b/frontend/test/frontend_tests/state_components_test.cljs @@ -1,4 +1,4 @@ -(ns app.components-basic-test +(ns frontend-tests.state-components-test (:require [app.common.data :as d] [app.common.geom.point :as gpt] @@ -10,13 +10,13 @@ [app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.libraries-helpers :as dwlh] [app.main.data.workspace.state-helpers :as wsh] - [app.test-helpers.events :as the] - [app.test-helpers.libraries :as thl] - [app.test-helpers.pages :as thp] [beicon.core :as rx] [cljs.pprint :refer [pprint]] [cljs.test :as t :include-macros true] [clojure.stacktrace :as stk] + [frontend-tests.helpers.events :as the] + [frontend-tests.helpers.libraries :as thl] + [frontend-tests.helpers.pages :as thp] [linked.core :as lks] [potok.core :as ptk])) diff --git a/frontend/test/app/util/range_tree_test.cljs b/frontend/test/frontend_tests/util_range_tree_test.cljs similarity index 95% rename from frontend/test/app/util/range_tree_test.cljs rename to frontend/test/frontend_tests/util_range_tree_test.cljs index 03aa9bf11..5f3627f73 100644 --- a/frontend/test/app/util/range_tree_test.cljs +++ b/frontend/test/frontend_tests/util_range_tree_test.cljs @@ -1,9 +1,15 @@ -(ns app.util.range-tree-test +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.util-range-tree-test (:require - [cljs.test :as t :include-macros true] - [cljs.pprint :refer [pprint]] [app.common.geom.point :as gpt] - [app.util.range-tree :as rt])) + [app.util.range-tree :as rt] + [cljs.pprint :refer [pprint]] + [cljs.test :as t :include-macros true])) (defn check-max-height [tree num-nodes]) (defn check-sorted [tree]) diff --git a/frontend/test/app/util/simple_math_test.cljs b/frontend/test/frontend_tests/util_simple_math_test.cljs similarity index 91% rename from frontend/test/app/util/simple_math_test.cljs rename to frontend/test/frontend_tests/util_simple_math_test.cljs index c6538e004..acd23526c 100644 --- a/frontend/test/app/util/simple_math_test.cljs +++ b/frontend/test/frontend_tests/util_simple_math_test.cljs @@ -1,4 +1,10 @@ -(ns app.util.simple-math-test +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns frontend-tests.util-simple-math-test (:require [cljs.test :as t :include-macros true] [cljs.pprint :refer [pprint]] diff --git a/frontend/test/app/util/snap_data_test.cljs b/frontend/test/frontend_tests/util_snap_data_test.cljs similarity index 99% rename from frontend/test/app/util/snap_data_test.cljs rename to frontend/test/frontend_tests/util_snap_data_test.cljs index 2c1c3d210..1ede8838a 100644 --- a/frontend/test/app/util/snap_data_test.cljs +++ b/frontend/test/frontend_tests/util_snap_data_test.cljs @@ -4,13 +4,13 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns app.util.snap-data-test +(ns frontend-tests.util-snap-data-test (:require - [app.common.uuid :as uuid] - [cljs.test :as t :include-macros true] - [cljs.pprint :refer [pprint]] [app.common.file-builder :as fb] - [app.util.snap-data :as sd])) + [app.common.uuid :as uuid] + [app.util.snap-data :as sd] + [cljs.pprint :refer [pprint]] + [cljs.test :as t :include-macros true])) (t/deftest test-create-index (t/testing "Create empty data"