Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Enable all working test suites and add linux-cabal job in Azure #1571

Merged
merged 80 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
a7d4a60
Publish artifacts and generate hoogle
jneira Dec 27, 2019
749c35c
Correct identation
jneira Dec 27, 2019
24b50bb
Correct YAML_FILE env var name
jneira Dec 27, 2019
df7e821
Set unique artifact and tar file name
jneira Dec 27, 2019
60c309e
Set unique artifact name and use 7z
jneira Dec 27, 2019
44d6288
Fix build-latest target
jneira Dec 27, 2019
2d50e4d
build using the install script with cabal
jneira Dec 27, 2019
b964691
Remove unused submodules
jneira Dec 27, 2019
01c9eb0
Correct 7z argument
jneira Dec 27, 2019
e66be51
Use simple access to env var
jneira Dec 27, 2019
4a603e5
Add ghc to artifact name
jneira Dec 28, 2019
b2d305b
Fix z3 install in macos
jneira Dec 28, 2019
15dbb1e
Install cabal-3.0.0.0 to test install.hs
jneira Dec 28, 2019
37c4951
Comment publishing for now
jneira Dec 28, 2019
d92b7a9
Activate win publishing again
jneira Jan 2, 2020
0af278b
quote cache keys
jneira Jan 2, 2020
c3fbfed
Use last version of cache task
jneira Jan 2, 2020
9e0aa06
Set ghc on path to fix build-latest
jneira Jan 2, 2020
5d06f0d
Return to comment tests
jneira Jan 2, 2020
38ed8ac
Correct var assignment
jneira Jan 2, 2020
2124425
try to avoid errors installing happy
jneira Jan 2, 2020
7c735ed
Use last version of cache task
jneira Jan 3, 2020
a3ccef0
Quote cache name
jneira Jan 3, 2020
fd04e37
Put the ghc exe dir in path
jneira Jan 3, 2020
6ff686d
Use one cache like posix
jneira Jan 3, 2020
149d332
Add more fine-grained git triggers
jneira Jan 3, 2020
af367d8
Create local bin path to fix cabal script
jneira Jan 3, 2020
48a7dc1
Remove creation of local bin path
jneira Jan 3, 2020
a844375
Comment windows-installhs-cabal job for now
jneira Jan 5, 2020
099a4c1
Enable the task again
jneira Jan 5, 2020
d0c0479
Comment the failing step
jneira Jan 5, 2020
36f3413
Using build instead install is enough to exec hoogle
jneira Jan 5, 2020
aa28ee0
Add TODO about using choco to install cabal
jneira Jan 5, 2020
da88a78
Set verbose mode for tar commands
jneira Jan 7, 2020
7b2f028
Add hlint data file
jneira Jan 7, 2020
d22032f
Use azure predefined variable Agent.TempDirectory
jneira Jan 7, 2020
60ff59d
Quote temp path to fix windows release
jneira Jan 7, 2020
45fda96
Update targets of install.hs for macos
jneira Jan 8, 2020
a5ee458
Enable tests
jneira Jan 8, 2020
b725aa7
Install correct version of liquid
jneira Jan 8, 2020
345e3ff
Merge branch 'master' into azure-release-tests
jneira Jan 10, 2020
fabadf6
Comment failing tests
jneira Jan 10, 2020
8d1f20a
Ignore exe files generated by tests
jneira Jan 10, 2020
1320278
Add test runtime dependency: cabal
jneira Jan 10, 2020
c97dc95
Add ghc to path
jneira Jan 10, 2020
3954c97
Sanity check of cabal and ghc
jneira Jan 11, 2020
e50d26d
Check path
jneira Jan 11, 2020
7b38a04
Isolate cabal in
jneira Jan 12, 2020
0544a82
Correct test target
jneira Jan 12, 2020
0b4ef57
Disable func-test for macos and ghc-8.4
jneira Jan 12, 2020
c870bfa
Disable CabalHelper tests for windows and ghc-8.6.4
jneira Jan 12, 2020
7da8d07
Correct test arguments
jneira Jan 12, 2020
ec7165d
Add cabal job
jneira Jan 8, 2020
a060cc5
Add cabal job only
jneira Jan 8, 2020
60f8cfe
Use default install options
jneira Jan 8, 2020
d60c115
Correct cache key
jneira Jan 8, 2020
aef9cdd
Set verbose mode for tar extraction
jneira Jan 8, 2020
40e9bb8
Run cabal update at first step
jneira Jan 8, 2020
edb6038
Correct name and use ghc on path
jneira Jan 8, 2020
27fcf16
Install liquid in temp to avoid reinstall hie
jneira Jan 9, 2020
1d9828a
liquidhaskell-0.8.6.2 needs ghc-8.6
jneira Jan 9, 2020
c9c195c
use full path to ghc
jneira Jan 9, 2020
a3f4387
Generate hoogle db
jneira Jan 9, 2020
bc28787
Turn off parallelism in tests
jneira Jan 10, 2020
7019fbf
Correct jobs argument
jneira Jan 10, 2020
632e37a
Set GHC_VERSION with YAML_FILE for stack
jneira Jan 10, 2020
5770241
Use specific bashrc for cabal
jneira Jan 12, 2020
cff204a
Use specific bashrc for cabal in yaml
jneira Jan 12, 2020
b47fb8d
Enable all jobs
jneira Jan 12, 2020
e89689e
Delete unused variable
jneira Jan 12, 2020
3e6b323
Enable windows+cabal job fot install.hs
jneira Jan 12, 2020
183c49a
Correct typo
jneira Jan 13, 2020
5fa01ad
Add TODO about parallel test runs
jneira Jan 13, 2020
5aa6b8f
Enable func-test suite in windows
jneira Jan 13, 2020
76e6d92
Disable func-test for ghc-8.6.4 on windows
jneira Jan 14, 2020
f81e35f
Sometimes in azure ci it returns 2 diagnostics
jneira Jan 14, 2020
7698b00
Enable diagnostics test in windows
jneira Jan 14, 2020
6c2fb2a
overwrite existing executable symlinks
jneira Jan 14, 2020
d40f403
Fix diagnostics test when they come in diff order
jneira Jan 14, 2020
e614529
Try install.hs latest twice
jneira Jan 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .azure/linux-cabal.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=$HOME/.cabal/bin:/opt/cabal/$CABAL_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$HOME/.local/bin:$PATH
76 changes: 76 additions & 0 deletions .azure/linux-cabal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
jobs:
- job: Linux_Cabal
timeoutInMinutes: 0
pool:
vmImage: ubuntu-16.04
strategy:
matrix:
ghc-8.6.5:
GHC_VERSION: "8.6.5"
ghc-8.4.4:
GHC_VERSION: "8.4.4"
variables:
CABAL_VERSION: "3.0"
steps:
- task: Cache@2
inputs:
key: '"cabal-store" | "$(Agent.OS)" | "$(CABAL_VERSION)" | "$(GHC_VERSION)" | $(Build.SourcesDirectory)/cabal.project | $(Build.SourcesDirectory)/haskell-ide-engine.cabal | $(Build.SourcesDirectory)/hie-plugin-api/hie-plugin-api.cabal'
path: .azure-cache
cacheHitVar: CACHE_RESTORED
displayName: "Download cache"
- bash: |
mkdir -p $HOME/.cabal
tar -vxzf .azure-cache/cabal-root.tar.gz -C /
mkdir -p $HOME/.ghc
tar -vxzf .azure-cache/ghc-root.tar.gz -C /
mkdir -p dist-newtyle
tar -vxzf .azure-cache/cabal-dist.tar.gz
displayName: "Unpack cache"
condition: eq(variables.CACHE_RESTORED, 'true')
- bash: |
git submodule sync
git submodule update --init
displayName: Sync submodules
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-update
cabal v2-build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build
displayName: Build `hie`
jneira marked this conversation as resolved.
Show resolved Hide resolved
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-install --overwrite-policy=always # `hie` binary required locally for tests
displayName: Install `hie`
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
displayName: Build Test-dependencies
- bash: |
sudo apt update
sudo apt install z3
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/linux-cabal.bashrc
# to not reinstall hie
cd $(Agent.TempDirectory)
cabal v2-install liquidhaskell-0.8.6.2 -w /opt/ghc/8.6.5/bin/ghc --overwrite-policy=always
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build hoogle
cabal v2-exec hoogle generate
displayName: "Install Runtime Test-Dependencies: hoogle database"
- bash: |
source .azure/linux-cabal.bashrc
# TODO: Investigate why the test suite can't be run in parallel
cabal v2-test -j1
jneira marked this conversation as resolved.
Show resolved Hide resolved
displayName: Run Test
- bash: |
mkdir -p .azure-cache
tar -vczf .azure-cache/cabal-root.tar.gz $HOME/.cabal
tar -vczf .azure-cache/ghc-root.tar.gz $HOME/.ghc
tar -vczf .azure-cache/cabal-dist.tar.gz dist-newstyle
displayName: "Pack cache"
File renamed without changes.
26 changes: 14 additions & 12 deletions .azure/linux-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ jobs:
tar vxz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
displayName: Install stack
- bash: |
source .azure/linux.bashrc
source .azure/linux-stack.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/linux.bashrc
source .azure/linux-stack.bashrc
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/linux.bashrc
source .azure/linux-stack.bashrc
stack build --stack-yaml $(YAML_FILE)
displayName: Build `hie`
- bash: |
source .azure/linux.bashrc
source .azure/linux-stack.bashrc
stack install --stack-yaml $(YAML_FILE) # `hie` binary required locally for tests
mkdir .azure-deploy
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
Expand All @@ -80,26 +80,28 @@ jobs:
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
displayName: Install `hie`
- bash: |
source .azure/linux.bashrc
source .azure/linux-stack.bashrc
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
displayName: Build Test-dependencies
- bash: |
sudo apt update
sudo apt install z3
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/linux.bashrc
stack install --resolver=lts-11.18 liquid-fixpoint-0.7.0.7 dotgen-0.4.2 fgl-visualize-0.1.0.1 located-base-0.1.1.1 liquidhaskell-0.8.2.4
source .azure/linux-stack.bashrc
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/linux.bashrc
source .azure/linux-stack.bashrc
stack build hoogle --stack-yaml=$(YAML_FILE)
stack exec hoogle generate --stack-yaml=$(YAML_FILE)
displayName: "Install Runtime Test-Dependencies: hoogle database"
# - bash: |
# source .azure/linux.bashrc
# stack test --stack-yaml $(YAML_FILE)
# displayName: Run Test
- bash: |
source .azure/linux-stack.bashrc
# cabal is also a test runtime dependency
export PATH=/opt/cabal/3.0/bin:$PATH
stack test --stack-yaml $(YAML_FILE)
displayName: Run Test
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Expand Down
20 changes: 15 additions & 5 deletions .azure/macos-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,27 @@ jobs:
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/macos.bashrc
stack install --resolver=lts-11.18 liquid-fixpoint-0.7.0.7 dotgen-0.4.2 fgl-visualize-0.1.0.1 located-base-0.1.1.1 liquidhaskell-0.8.2.4
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/macos.bashrc
stack build hoogle --stack-yaml=$(YAML_FILE)
stack exec hoogle generate --stack-yaml=$(YAML_FILE)
displayName: "Install Runtime Test-Dependencies: hoogle database"
# - bash: |
# source .azure/macos.bashrc
# stack test --stack-yaml $(YAML_FILE)
# displayName: Run Test
- bash: |
source .azure/macos.bashrc
brew install cabal-install
displayName: "Install Runtime Test-Dependencies: cabal"
- bash: |
source .azure/macos.bashrc
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
stack test --stack-yaml $(YAML_FILE)
else
#TODO Enable dispatcher-test and func-test for ghc-8.4.*
stack test --stack-yaml $(YAML_FILE) :unit-test :plugin-dispatcher-test :wrapper-test
fi
displayName: Run Test
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Expand Down
3 changes: 2 additions & 1 deletion .azure/windows-installhs-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ jobs:
displayName: Run help of `install.hs`
- bash: |
source .azure/windows.bashrc
stack install.hs latest
# Some executions fails with spurious errors installing the exe
stack install.hs latest || stack install.hs latest
displayName: Run latest target of `install.hs`
27 changes: 21 additions & 6 deletions .azure/windows-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,33 @@ jobs:
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/windows.bashrc
stack install --resolver=lts-11.18 liquid-fixpoint-0.7.0.7 dotgen-0.4.2 fgl-visualize-0.1.0.1 located-base-0.1.1.1 liquidhaskell-0.8.2.4
liquid -v
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/windows.bashrc
stack build hoogle --stack-yaml=$(YAML_FILE)
stack exec hoogle generate --stack-yaml=$(YAML_FILE)
displayName: "Install Runtime Test-Dependencies: hoogle database"
# - bash: |
# source .azure/windows.bashrc
# stack test --stack-yaml $(YAML_FILE) :unit-test
# displayName: Run Test
- bash: |
source .azure/windows.bashrc
choco install cabal
/C/ProgramData/chocolatey/bin/RefreshEnv.cmd
displayName: "Install Runtime Test-Dependencies: cabal"
- bash: |
source .azure/windows.bashrc
# TODO: Enable CabalHelper unit tests, see https://github.com/DanielG/cabal-helper/issues/91
if [ $YAML_FILE = "stack-8.6.4.yaml" ]; then
TEST_ARGS=--test-arguments="--skip=CabalHelper"
fi
# TODO: Enable rest of test suites
stack test --stack-yaml $(YAML_FILE) :unit-test :plugin-dispatcher-test $TEST_ARGS # :dispatcher-test :wrapper-test
# TODO: Enable failing functional test
if [ $YAML_FILE != "stack-8.6.4.yaml" ]; then
stack test --stack-yaml $(YAML_FILE) :func-test
else
stack test --stack-yaml $(YAML_FILE) :func-test --ta="--skip \"/Hover/hover/works\""
fi
displayName: Run Test
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
/docs/source/__pycache__/
/docs/source/plugins/
/elisp/.cask/
/test/testdata/*.exe
jneira marked this conversation as resolved.
Show resolved Hide resolved
/test/testdata/FuncTest.refactored.hs
/test/testdata/HaReAddRmParam.refactored.hs
/test/testdata/HaReCase.refactored.hs
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pr:

jobs:
- template: ./.azure/linux-stack.yml
- template: ./.azure/linux-cabal.yml
- template: ./.azure/windows-stack.yml
- template: ./.azure/macos-stack.yml
- template: ./.azure/linux-installhs-stack.yml
Expand Down
17 changes: 5 additions & 12 deletions test/functional/DiagnosticsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,18 @@ spec = describe "diagnostics providers" $ do
reduceDiag ^. LSP.source `shouldBe` Just "hlint"

diags2a <- waitForDiagnostics
-- liftIO $ show diags2a `shouldBe` ""

liftIO $ length diags2a `shouldBe` 2

-- docItem <- getDocItem file languageId
sendNotification TextDocumentDidSave (DidSaveTextDocumentParams doc)
-- diags2hlint <- waitForDiagnostics
-- -- liftIO $ show diags2hlint `shouldBe` ""
-- liftIO $ length diags2hlint `shouldBe` 3
-- diags2liquid <- waitForDiagnostics
-- liftIO $ length diags2liquid `shouldBe` 3
-- -- liftIO $ show diags2 `shouldBe` ""
diags3@(d:_) <- waitForDiagnostics
-- liftIO $ show diags3 `shouldBe` ""

diags3@(d:_) <- waitForDiagnosticsSource "eg2"

liftIO $ do
length diags3 `shouldBe` 3
length diags3 `shouldBe` 1
d ^. LSP.range `shouldBe` Range (Position 0 0) (Position 1 0)
d ^. LSP.severity `shouldBe` Nothing
d ^. LSP.code `shouldBe` Nothing
d ^. LSP.source `shouldBe` Just "eg2"
d ^. LSP.message `shouldBe` T.pack "Example plugin diagnostic, triggered byDiagnosticOnSave"

describe "typed hole errors" $
Expand Down