Skip to content

Commit d97d808

Browse files
committed
disable comment from test report
1 parent f8c7106 commit d97d808

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
with:
3838
report_paths: '**/build/test-results/test/TEST-*.xml'
3939
simplified_summary: true
40-
comment: true
40+
comment: false

src/test/clojure/com/github/clojure_lsp/intellij/foo_test.clj renamed to src/test/clojure/com/github/clojure_lsp/intellij/slurp_action_test.clj

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
(ns com.github.clojure-lsp.intellij.foo-test
1+
(ns com.github.clojure-lsp.intellij.slurp-action-test
22
(:require
33
[clojure.test :refer [deftest is]]
44
[com.github.clojure-lsp.intellij.editor :as editor]
55
[com.github.clojure-lsp.intellij.test-utils :as test-utils]
6-
[com.github.ericdallo.clj4intellij.test :as clj4intellij.test]))
6+
[com.github.ericdallo.clj4intellij.test :as clj4intellij.test])
7+
(:import
8+
[com.intellij.openapi.project Project]
9+
[com.intellij.testFramework.fixtures CodeInsightTestFixture]))
710

811
(set! *warn-on-reflection* true)
912

10-
(deftest foo-test
13+
(deftest slurp-action-test
1114
"Tests the Forward Slurp editor action functionality in Clojure LSP.
1215
This test:
1316
1. Sets up a test project with a Clojure file
@@ -21,8 +24,8 @@
2124
by moving the closing parenthesis forward."
2225
(let [project-name "clojure.core"
2326
{:keys [fixture project deps-file]} (test-utils/setup-test-project project-name)
24-
clj-file (.copyFileToProject fixture "foo.clj")]
25-
(is (= project-name (.getName project)))
27+
clj-file (.copyFileToProject ^CodeInsightTestFixture fixture "foo.clj")]
28+
(is (= project-name (.getName ^Project project)))
2629
(is deps-file)
2730

2831
(let [editor (test-utils/open-file-in-editor fixture clj-file)]
@@ -31,5 +34,5 @@
3134
(test-utils/run-editor-action "ClojureLSP.ForwardSlurp" project)
3235
(clj4intellij.test/dispatch-all)
3336
(println (test-utils/get-editor-text fixture))
34-
(.checkResultByFile fixture "foo_expected.clj")
37+
(.checkResultByFile ^CodeInsightTestFixture fixture "foo_expected.clj")
3538
(test-utils/teardown-test-project project))))

src/test/clojure/com/github/clojure_lsp/intellij/test_utils.clj

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
(ns com.github.clojure-lsp.intellij.test-utils
1+
(ns com.github.clojure-lsp.intellij.test-utils
22
(:require
33
[com.github.clojure-lsp.intellij.client :as lsp-client]
44
[com.github.clojure-lsp.intellij.server :as server]
55
[com.github.ericdallo.clj4intellij.app-manager :as app-manager]
6-
[com.github.ericdallo.clj4intellij.test :as clj4intellij.test]
7-
[com.github.clojure-lsp.intellij.db :as db])
6+
[com.github.ericdallo.clj4intellij.test :as clj4intellij.test])
87
(:import
98
[com.github.clojure_lsp.intellij.extension SettingsState]
109
[com.intellij.ide DataManager]
1110
[com.intellij.openapi.actionSystem ActionManager]
12-
[com.intellij.openapi.components ServiceManager]))
11+
[com.intellij.openapi.components ServiceManager]
12+
[com.intellij.testFramework.fixtures CodeInsightTestFixture]))
1313

1414
(set! *warn-on-reflection* true)
1515

1616
(defn get-editor-text
1717
"Returns the text content of the editor's document."
18-
[fixture]
18+
[^CodeInsightTestFixture fixture]
1919
(-> fixture .getEditor .getDocument .getText))
2020

2121
(defn open-file-in-editor
2222
"Opens a file in the editor and returns the editor instance."
23-
[fixture file]
23+
[^CodeInsightTestFixture fixture file]
2424
(let [project (.getProject fixture)]
2525
(app-manager/write-command-action
2626
project
@@ -40,7 +40,7 @@
4040
action
4141
(com.intellij.openapi.actionSystem.AnActionEvent/createFromDataContext action-id nil context))))))
4242

43-
(defn dispatch-all-until
43+
(defn wait-lsp-start
4444
"Dispatches all events until the LSP server is started or the timeout is reached."
4545
[{:keys [project millis timeout]
4646
:or {millis 1000
@@ -49,7 +49,6 @@
4949
(loop []
5050
(let [current-time (System/currentTimeMillis)
5151
elapsed-time (- current-time start-time)
52-
_ (println "Elapsed time >> " elapsed-time)
5352
status (lsp-client/server-status project)]
5453
(cond
5554
(>= elapsed-time timeout)
@@ -91,5 +90,4 @@
9190
(let [my-settings (ServiceManager/getService SettingsState)]
9291
(.loadState my-settings my-settings)
9392
(clj4intellij.test/dispatch-all)
94-
(dispatch-all-until {:project project})
95-
(println "status LSP >> " (db/get-in project [:status]))))
93+
(wait-lsp-start {:project project})))

0 commit comments

Comments
 (0)