Skip to content

Commit 26e9cec

Browse files
committed
Fix CI tests: download SonarLint before testing
1 parent 63ef56b commit 26e9cec

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ EASK ?= eask
55

66
TEST-FILES := $(shell ls test/*.el)
77

8-
.PHONY: clean checkdoc lint package install compile test
8+
.PHONY: clean checkdoc lint package install compile download-sonarlint test
99

10-
ci: clean package install compile test
10+
ci: clean package install compile download-sonarlint test
1111

1212
package:
1313
@echo "Packaging..."
@@ -21,6 +21,10 @@ compile:
2121
@echo "Compiling..."
2222
$(EASK) compile
2323

24+
download-sonarlint:
25+
@echo "Downloading SonarLint..."
26+
$(EASK) eval '(progn (require (quote lsp-sonarlint)) (lsp-sonarlint-download))'
27+
2428
test:
2529
@echo "Testing..."
2630
$(EASK) test ert $(TEST-FILES)

test/lsp-sonarlint-integration-test.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828
(require 'lsp-mode)
2929
(require 'lsp-sonarlint)
3030

31+
(ert-deftest lsp-sonarlint-plugin-downloaded ()
32+
"Check whether you have downloaded SonarLint.
33+
34+
This is a prerequisite for all the integration tests. If this
35+
test fails, you need to download the SonarLint plugin using
36+
37+
make download-sonarlint"
38+
(should (file-exists-p (concat lsp-sonarlint-download-dir "/extension/server/sonarlint-ls.jar"))))
39+
3140
(defun lsp-sonarlint--wait-for (predicate hook timeout)
3241
"Register PREDICATE to run on HOOK, and wait until it returns t.
3342
If that does not occur before TIMEOUT, throw an error."
@@ -72,7 +81,6 @@ only works for specific textDocument/didOpen:languageId."
7281
(lsp-enable-snippet nil)
7382
received-warnings)
7483
(let ((buf (find-file-noselect file))
75-
(lsp-sonarlint-plugin-autodownload t)
7684
(diagnostics-updated nil)
7785
(register-warning (lambda (&rest w) (when (equal (car w) 'lsp-mode)
7886
(push (cadr w) received-warnings)))))

0 commit comments

Comments
 (0)