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

Fix failing tests in windows (reloaded) #1655

Merged
merged 2 commits into from
Feb 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .azure/windows-cabal.bashrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if [ -z "$CABAL_DIR" ]; then
CABAL_DIR="$APPDATA\\cabal"
fi
export GHCS_PATH=$(cygpath $ProgramData)/chocolatey/lib/ghc/tools
export GHC_PATH=$GHCS_PATH/ghc-$GHC_VERSION
export CABAL_ROOT=$(cygpath $CABAL_DIR)
Expand Down
25 changes: 10 additions & 15 deletions .azure/windows-cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ jobs:
GHC_VERSION: "8.4.4"
variables:
CABAL_VERSION: "3.0.0.0"
CABAL_DIR: "D:\\cabal"
CABAL_STORE_DIR: "D:\\sd"
CABAL_DIR: ""
CABAL_STORE_DIR: "C:\\sd"
LIQUID_VERSION: "0.8.6.2"
STACK_ROOT: "D:\\sr"
STACK_ROOT: "C:\\sr"
steps:
- task: Cache@2
inputs:
key: '"cabal-v2" | "$(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'
key: '"cabal-v3" | "$(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: |
source .azure/windows-cabal.bashrc
mkdir -p $CABAL_ROOT
tar -vxzf .azure-cache/cabal-root.tar.gz -C /d
tar -vxzf .azure-cache/cabal-root.tar.gz -C /c
mkdir -p $CABAL_STORE_DIR
tar -vxzf .azure-cache/cabal-store.tar.gz -C /d
tar -vxzf .azure-cache/cabal-store.tar.gz -C /c
mkdir -p ${CABAL_STORE_DIR}i
tar -vxzf .azure-cache/cabal-store-install.tar.gz -C /d
tar -vxzf .azure-cache/cabal-store-install.tar.gz -C /c
mkdir -p dist-newstyle
tar -vxzf .azure-cache/cabal-dist.tar.gz
displayName: "Unpack cache"
Expand Down Expand Up @@ -95,17 +95,12 @@ jobs:
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
mkdir -p "$STACK_ROOT"
echo "local-programs-path: D:/bin/stack" > $STACK_ROOT/config.yaml
# If we don't install the ghc used in test projects in advance, tests fail
stack setup --resolver=lts-14.20
stack setup --stack-yaml stack-${GHC_VERSION}.yaml
displayName: "Install Runtime Unit Test-Dependencies: stack"
- bash: |
source .azure/windows-cabal.bashrc
# TODO: Enable CabalHelper tests
if [ $GHC_VERSION = "8.4.4" ]; then
TEST_OPTIONS=--test-options="--skip=CabalHelper"
fi
cabal v2-test :unit-test $TEST_OPTIONS
cabal v2-test :unit-test
displayName: "Run Test: unit-test"
# TODO: Enable rest of test suites in windows
- bash: |
Expand All @@ -117,7 +112,7 @@ jobs:
source .azure/windows-cabal.bashrc
# TODO: Enable for 8.4.4
if [ $GHC_VERSION != "8.4.4" ]; then
cabal v2-test :func-test $TEST_OPTIONS
cabal v2-test :func-test
fi
displayName: "Run Test: func-test"
- bash: |
Expand Down
8 changes: 4 additions & 4 deletions .azure/windows-installhs-cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ jobs:
GHC_VERSION: "8.6.5"
CABAL_VERSION: "3.0.0.0"
CABAL_DIR: "" # To use the default one (cabal-hie-install latest fails with a custom one)
CABAL_STORE_DIR: "D:\\sd"
CABAL_STORE_DIR: "C:\\sd"
PROJECT_FILE: "./install/shake.project"
steps:
- task: Cache@2
inputs:
key: '"cabal-installhs" | "$(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'
key: '"cabal-installhs-v1" | "$(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: |
source .azure/windows-cabal.bashrc
mkdir -p $CABAL_ROOT
tar -vxzf .azure-cache/cabal-root.tar.gz -C /d
tar -vxzf .azure-cache/cabal-root.tar.gz -C /c
mkdir -p $CABAL_STORE_DIR
tar -vxzf .azure-cache/cabal-store.tar.gz -C /d
tar -vxzf .azure-cache/cabal-store.tar.gz -C /c
mkdir -p ./dist-newstyle
tar -vxzf .azure-cache/cabal-dist.tar.gz
displayName: "Unpack cache"
Expand Down
7 changes: 3 additions & 4 deletions .azure/windows-installhs-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ jobs:
vmImage: windows-2019
variables:
YAML_FILE: install/shake.yaml
STACK_ROOT: "D:\\sr"
STACK_ROOT: "C:\\sr"
steps:
- task: Cache@2
inputs:
key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE) | $(Build.SourcesDirectory)/install/shake.yaml'
key: '"stack-installhs-v1" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE) | $(Build.SourcesDirectory)/install/shake.yaml'
path: .azure-cache
cacheHitVar: CACHE_RESTORED
displayName: "Cache stack-root"
- bash: |
mkdir -p "$STACK_ROOT"
tar -vxzf .azure-cache/stack-root.tar.gz -C /d
tar -vxzf .azure-cache/stack-root.tar.gz -C /c
mkdir -p .stack-work
tar -vxzf .azure-cache/stack-work.tar.gz
mkdir -p ./install/.stack-work
Expand All @@ -26,7 +26,6 @@ jobs:
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
mkdir -p "$STACK_ROOT"
echo "local-programs-path: D:/bin/stack" > "$STACK_ROOT/config.yaml"
displayName: Install stack
- bash: |
source .azure/windows-stack.bashrc
Expand Down
4 changes: 4 additions & 0 deletions .azure/windows-stack.bashrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if [ -z "$CABAL_DIR" ]; then
CABAL_DIR="$APPDATA\\cabal"
fi
export LOCAL_BIN_PATH=$(cygpath $APPDATA\\local\\bin)
export CABAL_ROOT=$(cygpath $CABAL_DIR)
export Z3_BIN_PATH=/usr/local/z3-4.8.5-x64-win/bin
export PATH=$Z3_BIN_PATH:$LOCAL_BIN_PATH:$PATH
20 changes: 11 additions & 9 deletions .azure/windows-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ jobs:
stack-8.4.2:
YAML_FILE: stack-8.4.2.yaml
variables:
STACK_ROOT: "D:\\sr"
STACK_ROOT: "C:\\sr"
CABAL_VERSION: "3.0.0.0"
CABAL_STORE_DIR: "C:\\sd"

steps:
- task: Cache@2
inputs:
key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)'
key: '"stack-v3" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)'
path: .azure-cache
cacheHitVar: CACHE_RESTORED
displayName: "Cache stack-root"
- bash: |
mkdir -p $STACK_ROOT
tar -vxzf .azure-cache/stack-root.tar.gz -C /d
tar -vxzf .azure-cache/stack-root.tar.gz -C /c
mkdir -p .stack-work
tar -vxzf .azure-cache/stack-work.tar.gz
displayName: "Unpack cache"
Expand All @@ -47,7 +48,6 @@ jobs:
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
mkdir -p "$STACK_ROOT"
echo "local-programs-path: D:/bin/stack" > "$STACK_ROOT/config.yaml"
displayName: Install stack
- bash: |
source .azure/windows-stack.bashrc
Expand Down Expand Up @@ -92,6 +92,8 @@ jobs:
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/windows-stack.bashrc
# To make stack not pick default stack.yaml if it uses the same ghc than lts-13.20
cd "$(Agent.TempDirectory)"
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
Expand All @@ -103,14 +105,14 @@ jobs:
source .azure/windows-stack.bashrc
choco install -y cabal --version $CABAL_VERSION
/C/ProgramData/chocolatey/bin/RefreshEnv.cmd
cabal v2-update
echo "store-dir: $CABAL_STORE_DIR" >> /config
displayName: "Install Runtime Test-Dependencies: cabal"
- bash: |
source .azure/windows-stack.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
stack test :unit-test $TEST_ARGS --stack-yaml $(YAML_FILE)
# hie assumes that ghc is in path for cabal cradles (Haskell.Ide.Engine.Cradle.execProjectGhc)
export PATH="$(stack path --compiler-bin --stack-yaml $YAML_FILE)":$PATH
stack test :unit-test --stack-yaml $(YAML_FILE)
displayName: "Run Test: unit-test"
# TODO: Enable rest of test suites in windows
- bash: |
Expand Down
6 changes: 6 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
packages:
./
./hie-plugin-api/

-- ./submodules/HaRe

source-repository-package
type: git
location: https://github.com/jneira/cabal-helper.git
tag: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2

tests: true

package haskell-ide-engine
Expand Down
4 changes: 3 additions & 1 deletion stack-8.4.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ extra-deps:
- bifunctors-5.5.6
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- cabal-plan-0.5.0.0
- connection-0.3.1 # for network and network-bsd
- constrained-dynamic-0.1.0.0
Expand Down
4 changes: 3 additions & 1 deletion stack-8.4.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ extra-deps:
- bifunctors-5.5.7
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- cabal-plan-0.6.2.0
- connection-0.3.1 # for network and network-bsd
- constrained-dynamic-0.1.0.0
Expand Down
4 changes: 3 additions & 1 deletion stack-8.4.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ extra-deps:
- bifunctors-5.5.6
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- cabal-plan-0.5.0.0
- connection-0.3.1 # for network and network-bsd
- constrained-dynamic-0.1.0.0
Expand Down
4 changes: 3 additions & 1 deletion stack-8.6.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ extra-deps:
- brittany-0.12.1.1
- butcher-1.3.2.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- cabal-plan-0.5.0.0
- constrained-dynamic-0.1.0.0
- extra-1.6.18
Expand Down
4 changes: 3 additions & 1 deletion stack-8.6.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ extra-deps:
- base-compat-0.11.1
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- cabal-plan-0.6.2.0
- clock-0.7.2
- constrained-dynamic-0.1.0.0
Expand Down
4 changes: 3 additions & 1 deletion stack-8.8.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ extra-deps:
- apply-refact-0.7.0.0
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- clock-0.7.2
- constrained-dynamic-0.1.0.0
- floskell-0.10.2
Expand Down
4 changes: 3 additions & 1 deletion stack-8.8.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ extra-deps:
- apply-refact-0.7.0.0
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- clock-0.7.2
- constrained-dynamic-0.1.0.0
- floskell-0.10.2
Expand Down
4 changes: 3 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ extra-deps:
- apply-refact-0.7.0.0
- brittany-0.12.1.1
- bytestring-trie-0.2.5.0
- cabal-helper-1.0.0.0
# - cabal-helper-1.0.0.0
- github: jneira/cabal-helper
commit: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2
- clock-0.7.2
- constrained-dynamic-0.1.0.0
- floskell-0.10.2
Expand Down