Skip to content

Commit 00e3577

Browse files
authored
Enable hls-tactics-plugin tests in CI (#1474)
* Enable hls-tactics-plugin tests in CI * Revert a bug in `auto` that caused test failures
1 parent a70711a commit 00e3577

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,8 @@ jobs:
119119
# all functional test cases simultaneously which causes way too many hls
120120
# instances to be spun up for the poor github actions runner to handle
121121
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"
122+
123+
- name: Test hls-tactics-plugin test suite
124+
if: ${{ matrix.test }}
125+
run: LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="-j1"
126+

plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/KnownStrategies.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
module Ide.Plugin.Tactic.KnownStrategies where
44

5-
import Control.Monad.Error.Class
6-
import Ide.Plugin.Tactic.Context (getCurrentDefinitions)
7-
import Ide.Plugin.Tactic.KnownStrategies.QuickCheck (deriveArbitrary)
8-
import Ide.Plugin.Tactic.Machinery (tracing, try')
9-
import Ide.Plugin.Tactic.Tactics
10-
import Ide.Plugin.Tactic.Types
11-
import OccName (mkVarOcc)
12-
import Refinery.Tactic
5+
import Control.Monad.Error.Class
6+
import Ide.Plugin.Tactic.Context (getCurrentDefinitions)
7+
import Ide.Plugin.Tactic.KnownStrategies.QuickCheck (deriveArbitrary)
8+
import Ide.Plugin.Tactic.Machinery (tracing)
9+
import Ide.Plugin.Tactic.Tactics
10+
import Ide.Plugin.Tactic.Types
11+
import OccName (mkVarOcc)
12+
import Refinery.Tactic
1313

1414

1515
knownStrategies :: TacticsM ()
@@ -29,7 +29,7 @@ known name t = do
2929

3030
deriveFmap :: TacticsM ()
3131
deriveFmap = do
32-
try' intros
32+
try intros
3333
overAlgebraicTerms homo
3434
choice
3535
[ overFunctions apply >> auto' 2

plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/Machinery.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ requireConcreteHole m = do
278278
-- balloons the search space. This thing just tries it, but doesn't backtrack
279279
-- if it fails.
280280
--
281+
-- NOTE(sandy): But there's a bug! Or at least, something not understood here.
282+
-- Using this everywhere breaks te tests, and neither I nor TOTBWF are sure
283+
-- why. Prefer 'try' if you can, and only try this as a last resort.
284+
--
281285
-- TODO(sandy): Remove this when we upgrade to 0.4
282286
try'
283287
:: Functor m

plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/Tactics.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ auto' :: Int -> TacticsM ()
319319
auto' 0 = throwError NoProgress
320320
auto' n = do
321321
let loop = auto' (n - 1)
322-
try' intros
322+
try intros
323323
choice
324324
[ overFunctions $ \fname -> do
325325
apply fname

0 commit comments

Comments
 (0)