From b30a2a5b0790f1881c5c562de1882aaebb26291a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:36:06 +0300 Subject: [PATCH 01/12] Remove sources.txt --- sources.txt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 sources.txt diff --git a/sources.txt b/sources.txt deleted file mode 100644 index 1452bfc6..00000000 --- a/sources.txt +++ /dev/null @@ -1,13 +0,0 @@ -./yesod-core -./yesod-static -./yesod-persistent -./yesod-newsfeed -./yesod-form -./yesod-auth -./yesod-auth-oauth -./yesod-sitemap -./yesod-test -./yesod-bin -./yesod -./yesod-eventsource -./yesod-websockets From 3015a9a9f1f0b87cbd2053d638624f235e5dafe2 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:36:35 +0300 Subject: [PATCH 02/12] Remove out-of-date README --- README | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 README diff --git a/README b/README deleted file mode 100644 index c2ba6ace..00000000 --- a/README +++ /dev/null @@ -1,15 +0,0 @@ -Authentication methods for Haskell web applications. - -Note for Rpxnow: -By default on some (all?) installs wget does not come with root certificates -for SSL. If this is the case then Web.Authenticate.Rpxnow.authenticate will -fail as wget cannot establish a secure connection to rpxnow's servers. - -A simple *nix solution, if potentially insecure (man in the middle attacks as -you are downloading the certs) is to grab a copy of the certs extracted from -those that come with firefox, hosted by CURL at -http://curl.haxx.se/ca/cacert.pem , put them somewhere (for ex, -~/.wget/cacert.pem) and then edit your ~/.wgetrc to include: -ca_certificate=~/.wget/cacert.pem - -This should fix the problem. From abdea8d157aa75cec3271d7714887b36233e6895 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:37:00 +0300 Subject: [PATCH 03/12] Remove out-of-date ReleaseNotes.md --- ReleaseNotes.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 ReleaseNotes.md diff --git a/ReleaseNotes.md b/ReleaseNotes.md deleted file mode 100644 index 1d8b65fd..00000000 --- a/ReleaseNotes.md +++ /dev/null @@ -1,5 +0,0 @@ -Release notes are maintained on the wiki. - -https://github.com/yesodweb/yesod/wiki/Changelog (high level features) - -https://github.com/yesodweb/yesod/wiki/Detailed-change-list (see for breaking changes) From d9d4863fc15fea4cc5d343f9092290784ee9d082 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:37:18 +0300 Subject: [PATCH 04/12] Remove appveyor --- appveyor.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a97d407b..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -# cache: -# - '%AppData%\stack' - -install: - - curl -sS -ostack.zip -L https://get.haskellstack.org/stable/windows-i386.zip - - 7z x stack.zip stack.exe - - stack setup > nul - -build: off - -build_script: - - stack --no-terminal test --no-run-tests --resolver lts-11 - -test_script: - - stack --jobs 1 --no-terminal test --resolver lts-11 From c7bb2d22afcfa386711729d57167d95c307a4b4e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:44:26 +0300 Subject: [PATCH 05/12] Remove Travis config --- .travis.yml | 212 ---------------------------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e0b8018..00000000 --- a/.travis.yml +++ /dev/null @@ -1,212 +0,0 @@ -# This is the complex Travis configuration, which is intended for use -# on open source libraries which need compatibility across multiple GHC -# versions, must work with cabal-install, and should be -# cross-platform. For more information and other options, see: -# -# https://docs.haskellstack.org/en/stable/travis_ci/ -# -# Copy these contents into the root directory of your Github project in a file -# named .travis.yml - -# Use new container infrastructure to enable caching -sudo: false - -# Do not choose a language; we provide our own build tools. -language: generic - -# Caching so the next build will be fast too. -cache: - directories: - - $HOME/.ghc - - $HOME/.cabal - - $HOME/.stack - -# The different configurations we want to test. We have BUILD=cabal which uses -# cabal-install, and BUILD=stack which uses Stack. More documentation on each -# of those below. -# -# We set the compiler values here to tell Travis to use a different -# cache file per set of arguments. -# -# If you need to have different apt packages for each combination in the -# matrix, you can use a line such as: -# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}} -matrix: - include: - # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See: - # https://github.com/hvr/multi-ghc-travis - - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7 - compiler: ": #GHC 8.0.2" - addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7 - compiler: ": #GHC 8.2.2" - addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - env: BUILD=cabal GHCVER=8.4.4 CABALVER=2.2 HAPPYVER=1.19.5 ALEXVER=3.1.7 - compiler: ": #GHC 8.4.4" - addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - env: BUILD=cabal GHCVER=8.6.3 CABALVER=2.4 HAPPYVER=1.19.5 ALEXVER=3.1.7 - compiler: ": #GHC 8.6.3" - addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - # Build with the newest GHC and cabal-install. This is an accepted failure, - # see below. - - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7 - compiler: ": #GHC HEAD" - addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS - # variable, such as using --stack-yaml to point to a different file. - - env: BUILD=stack ARGS="" - compiler: ": #stack default" - addons: {apt: {packages: [libgmp-dev]}} - - - env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml --resolver lts-9" - compiler: ": #stack 8.0.2" - addons: {apt: {packages: [libgmp-dev]}} - - - env: BUILD=stack ARGS="--resolver lts-11" - compiler: ": #stack 8.2.2" - addons: {apt: {packages: [libgmp-dev]}} - - - env: BUILD=stack ARGS="--resolver lts-12" - compiler: ": #stack 8.4.4" - addons: {apt: {packages: [libgmp-dev]}} - - - env: BUILD=stack ARGS="--resolver lts-13" - compiler: ": #stack 8.6.3" - addons: {apt: {packages: [libgmp-dev]}} - - - env: BUILD=stack ARGS="--stack-yaml stack-persistent-2-9.yaml" - compiler: ": #stack/persistent 2.9" - addons: {apt: {packages: [libgmp-dev]}} - - - env: BUILD=stack ARGS="--stack-yaml stack-persistent-2-10.yaml" - compiler: ": #stack/persistent 2.10" - addons: {apt: {packages: [libgmp-dev]}} - - # Nightly builds are allowed to fail - - env: BUILD=stack ARGS="--resolver nightly" - compiler: ": #stack nightly" - addons: {apt: {packages: [libgmp-dev]}} - - # Build on macOS in addition to Linux - - env: BUILD=stack ARGS="" - compiler: ": #stack default osx" - os: osx - - - env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml --resolver lts-9" - compiler: ": #stack 8.0.2 osx" - os: osx - - - env: BUILD=stack ARGS="--resolver lts-11" - compiler: ": #stack 8.2.2 osx" - os: osx - - - env: BUILD=stack ARGS="--resolver lts-12" - compiler: ": #stack 8.4.4 osx" - os: osx - - - env: BUILD=stack ARGS="--resolver lts-13" - compiler: ": #stack 8.6.3 osx" - os: osx - - - env: BUILD=stack ARGS="--stack-yaml stack-persistent-2-9.yaml" - compiler: ": #stack/persistent 2.9" - os: osx - - - env: BUILD=stack ARGS="--stack-yaml stack-persistent-2-10.yaml" - compiler: ": #stack/persistent 2.10" - os: osx - - - env: BUILD=stack ARGS="--resolver nightly" - compiler: ": #stack nightly osx" - os: osx - - allow_failures: - - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7 - - env: BUILD=stack ARGS="--resolver nightly" - -before_install: -# Using compiler above sets CC to an invalid value, so unset it -- unset CC - -# We want to always allow newer versions of packages when building on GHC HEAD -- CABALARGS="" -- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi - -# Download and unpack the stack executable -- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH -- mkdir -p ~/.local/bin -- | - if [ `uname` = "Darwin" ] - then - travis_retry curl --insecure -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin - else - travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - fi - - # Use the more reliable S3 mirror of Hackage - mkdir -p $HOME/.cabal - echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config - echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config - - -install: -- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" -- if [ -f configure.ac ]; then autoreconf -i; fi -- | - set -ex - case "$BUILD" in - stack) - # Add in extra-deps for older snapshots, as necessary - stack --no-terminal --install-ghc $ARGS test --bench --dry-run || ( \ - stack --no-terminal $ARGS build cabal-install && \ - stack --no-terminal $ARGS solver --update-config) - - # Build the dependencies - stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies - ;; - cabal) - cabal --version - travis_retry cabal update - - # Get the list of packages from the stack.yaml file. Note that - # this will also implicitly run hpack as necessary to generate - # the .cabal files needed by cabal-install. - PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') - - cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES - ;; - esac - set +ex - -script: -- | - set -ex - case "$BUILD" in - stack) - stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps - ;; - cabal) - cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES - - # Times out - #ORIGDIR=$(pwd) - #for dir in $PACKAGES - #do - # cd $dir - # cabal check || [ "$CABALVER" == "1.16" ] - # cabal sdist - # PKGVER=$(cabal info . | awk '{print $2;exit}') - # SRC_TGZ=$PKGVER.tar.gz - # cd dist - # tar zxfv "$SRC_TGZ" - # cd "$PKGVER" - # cabal configure --enable-tests --ghc-options -O0 - # cabal build - # cabal test - # cd $ORIGDIR - #done - ;; - esac - set +ex From 772324e8cb142a00793f6cf61e2d510db2a983c5 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:44:47 +0300 Subject: [PATCH 06/12] Azure config --- .azure/azure-linux-template.yml | 118 ++++++++++++++++++++++++++++++ .azure/azure-osx-template.yml | 42 +++++++++++ .azure/azure-pipelines.yml | 30 ++++++++ .azure/azure-windows-template.yml | 34 +++++++++ 4 files changed, 224 insertions(+) create mode 100644 .azure/azure-linux-template.yml create mode 100644 .azure/azure-osx-template.yml create mode 100644 .azure/azure-pipelines.yml create mode 100644 .azure/azure-windows-template.yml diff --git a/.azure/azure-linux-template.yml b/.azure/azure-linux-template.yml new file mode 100644 index 00000000..9bb340e5 --- /dev/null +++ b/.azure/azure-linux-template.yml @@ -0,0 +1,118 @@ +jobs: +- job: ${{ parameters.name }} + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + matrix: + stack-def: + BUILD: stack + STACK_YAML: stack.yaml + stack-lts-9: + BUILD: stack + STACK_YAML: stack-lts-9.yaml + ARGS: "--resolver lts-9" + stack-lts-11: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-11" + stack-lts-12: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-12" + stack-lts-13: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-13" + stack-persistent-2-9: + BUILD: stack + STACK_YAML: stack-persistent-2-9.yaml + ARGS: "" + stack-persistent-2-10: + BUILD: stack + STACK_YAML: stack-persistent-2-10.yaml + ARGS: "" + cabal-8.0.2: + BUILD: cabal + GHCVER: 8.0.2 + CABALVER: 1.24 + cabal-8.2.2: + BUILD: cabal + GHCVER: 8.2.2 + CABALVER: 2.0 + cabal-8.4.4: + BUILD: cabal + GHCVER: 8.4.4 + CABALVER: 2.2 + cabal-8.6.5: + BUILD: cabal + GHCVER: 8.6.5 + CABALVER: 2.4 + nightly: + BUILD: stack + ARGS: "--resolver nightly" + pedantic: + BUILD: pedantic + STACK_YAML: stack.yaml + maxParallel: 6 + steps: + - script: | + export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; + mkdir -p ~/.local/bin + curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' + case "$BUILD" in + cabal) + sudo add-apt-repository -y ppa:hvr/ghc + sudo apt-get update + sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER + # See note here: https://github.com/haskell-CI/haskell-ci#alex--happy-with-ghc--78 + if [ "$GHCVER" = "head" ] || [ "${GHCVER%.*}" = "7.8" ] || [ "${GHCVER%.*}" = "7.10" ]; then + sudo apt-get install happy-1.19.4 alex-3.1.3 + export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH + else + sudo apt-get install happy alex + fi + export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + cabal --version + cabal update + PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') + cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES + ;; + *) + export PATH=$HOME/.local/bin:$PATH + stack --install-ghc $ARGS test --bench --only-dependencies + ;; + esac + set -ex + case "$BUILD" in + cabal) + cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES + + ORIGDIR=$(pwd) + for dir in $PACKAGES + do + cd $dir + cabal check || [ "$CABALVER" == "1.16" ] + cabal sdist + PKGVER=$(cabal info . | awk '{print $2;exit}') + SRC_TGZ=$PKGVER.tar.gz + cd dist + tar zxfv "$SRC_TGZ" + cd "$PKGVER" + cabal configure --enable-tests --ghc-options -O0 + cabal build + if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then + cabal test + else + cabal test --show-details=streaming + fi + cd $ORIGDIR + done + ;; + *) + stack $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps + ;; + esac + set +ex + env: + OS_NAME: ${{ parameters.os }} + displayName: 'Installation ${{parameters.os}} & Test' diff --git a/.azure/azure-osx-template.yml b/.azure/azure-osx-template.yml new file mode 100644 index 00000000..8b66b7a8 --- /dev/null +++ b/.azure/azure-osx-template.yml @@ -0,0 +1,42 @@ +jobs: +- job: ${{ parameters.name }} + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + matrix: + stack-lts-9: + BUILD: stack + STACK_YAML: stack-lts-9.yaml + ARGS: "--resolver lts-9" + stack-lts-11: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-11" + stack-lts-12: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-12" + stack-lts-13: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-13" + stack-persistent-2-9: + BUILD: stack + STACK_YAML: stack-persistent-2-9.yaml + ARGS: "" + stack-persistent-2-10: + BUILD: stack + STACK_YAML: stack-persistent-2-10.yaml + ARGS: "" + maxParallel: 3 + steps: + - script: | + export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; + mkdir -p ~/.local/bin + curl -skL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin; + export PATH=$HOME/.local/bin:$PATH + stack --install-ghc $ARGS test --bench --only-dependencies + stack $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps + env: + OS_NAME: ${{ parameters.os }} + displayName: 'Installation ${{parameters.os}} & Test' diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml new file mode 100644 index 00000000..870176e1 --- /dev/null +++ b/.azure/azure-pipelines.yml @@ -0,0 +1,30 @@ +# This is the complex Azure configuration, which is intended for use +# on open source libraries which need compatibility across multiple GHC +# versions, must work with cabal-install, and should be +# cross-platform. For more information and other options, see: +# +# https://docs.haskellstack.org/en/stable/azure_ci/ +# +# Copy these contents into the root directory of your Github project in a file +# named azure-pipelines.yml +# +# For better organization, you split various jobs into seprate parts +# and each of them are controlled via individual file. +jobs: +- template: azure-linux-template.yml + parameters: + name: Linux + vmImage: ubuntu-16.04 + os: linux + +- template: azure-osx-template.yml + parameters: + name: macOS + vmImage: macOS-10.13 + os: osx + +- template: azure-windows-template.yml + parameters: + name: Windows + vmImage: vs2017-win2016 + os: windows diff --git a/.azure/azure-windows-template.yml b/.azure/azure-windows-template.yml new file mode 100644 index 00000000..b5d07755 --- /dev/null +++ b/.azure/azure-windows-template.yml @@ -0,0 +1,34 @@ +jobs: +- job: ${{ parameters.name }} + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + matrix: + stack-lts-9: + BUILD: stack + STACK_YAML: stack-lts-9.yaml + ARGS: "--resolver lts-9" + stack-lts-11: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-11" + stack-lts-12: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-12" + stack-lts-13: + BUILD: stack + STACK_YAML: stack.yaml + ARGS: "--resolver lts-13" + maxParallel: 3 + steps: + - bash: | + export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; + curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip + unzip -o /usr/bin/stack.zip -d /usr/bin/ + stack setup $ARGS > /dev/null + stack --install-ghc $ARGS test --bench --only-dependencies + stack $ARGS test --bench --no-run-benchmarks + env: + OS_NAME: ${{ parameters.os }} + displayName: 'Installation ${{parameters.os}} & Test' From 5acc62b5e2f784491592e7b0a9e364bc695463c0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 18:48:37 +0300 Subject: [PATCH 07/12] Updated badge for Azure --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d26a5810..bb077f72 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/yesodweb/yesod.svg?branch=master)](https://travis-ci.org/yesodweb/yesod) +[![Build Status](https://dev.azure.com/yesodweb/yesod/_apis/build/status/yesodweb.yesod?branchName=master)](https://dev.azure.com/yesodweb/yesod/_build/latest?definitionId=3&branchName=master) # Yesod Web Framework From 5fe5e24eb00dd5fc1154acd4eeb4e1f168b6e52f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 29 Apr 2019 19:20:54 +0300 Subject: [PATCH 08/12] Add missing rio dependency Travis was handling this via the solver, which we don't want to be using --- stack-lts-9.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/stack-lts-9.yaml b/stack-lts-9.yaml index ad311b2e..3f5f1a7b 100644 --- a/stack-lts-9.yaml +++ b/stack-lts-9.yaml @@ -26,6 +26,7 @@ extra-deps: - persistent-sqlite-2.8.1.2@rev:0 - project-template-0.2.0.1@rev:0 - resourcet-1.2.1@rev:0 +- rio-0.1.8.0@rev:0 - streaming-commons-0.2.0.0@rev:0 - typed-process-0.2.2.0@rev:0 - unliftio-0.2.7.0@rev:0 From 5921a10ded61e42cc0ab384f59434da254ba4439 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 30 Apr 2019 04:47:30 +0300 Subject: [PATCH 09/12] Increase Azure timeout --- .azure/azure-linux-template.yml | 1 + .azure/azure-osx-template.yml | 1 + .azure/azure-windows-template.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.azure/azure-linux-template.yml b/.azure/azure-linux-template.yml index 9bb340e5..4b67a2be 100644 --- a/.azure/azure-linux-template.yml +++ b/.azure/azure-linux-template.yml @@ -1,5 +1,6 @@ jobs: - job: ${{ parameters.name }} + timeoutInMinutes: 120 pool: vmImage: ${{ parameters.vmImage }} strategy: diff --git a/.azure/azure-osx-template.yml b/.azure/azure-osx-template.yml index 8b66b7a8..f0517df5 100644 --- a/.azure/azure-osx-template.yml +++ b/.azure/azure-osx-template.yml @@ -1,5 +1,6 @@ jobs: - job: ${{ parameters.name }} + timeoutInMinutes: 120 pool: vmImage: ${{ parameters.vmImage }} strategy: diff --git a/.azure/azure-windows-template.yml b/.azure/azure-windows-template.yml index b5d07755..79abef7d 100644 --- a/.azure/azure-windows-template.yml +++ b/.azure/azure-windows-template.yml @@ -1,5 +1,6 @@ jobs: - job: ${{ parameters.name }} + timeoutInMinutes: 120 pool: vmImage: ${{ parameters.vmImage }} strategy: From 3ba15fb8d35c2c228d9891bf028594056d5531f3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 30 Apr 2019 04:53:14 +0300 Subject: [PATCH 10/12] Skip lts-9 on Windows (needs more extra-deps) --- .azure/azure-windows-template.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.azure/azure-windows-template.yml b/.azure/azure-windows-template.yml index 79abef7d..01b5d9dd 100644 --- a/.azure/azure-windows-template.yml +++ b/.azure/azure-windows-template.yml @@ -5,10 +5,6 @@ jobs: vmImage: ${{ parameters.vmImage }} strategy: matrix: - stack-lts-9: - BUILD: stack - STACK_YAML: stack-lts-9.yaml - ARGS: "--resolver lts-9" stack-lts-11: BUILD: stack STACK_YAML: stack.yaml From 3b58652483bba8ea4ce1807f7b649c8f1989bca3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 30 Apr 2019 05:13:10 +0300 Subject: [PATCH 11/12] Compat with network 3 --- yesod-test/Yesod/Test.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yesod-test/Yesod/Test.hs b/yesod-test/Yesod/Test.hs index 91d88866..9f886b76 100644 --- a/yesod-test/Yesod/Test.hs +++ b/yesod-test/Yesod/Test.hs @@ -148,7 +148,13 @@ import qualified Data.Text.Encoding.Error as TErr import qualified Data.ByteString.Lazy.Char8 as BSL8 import qualified Test.HUnit as HUnit import qualified Network.HTTP.Types as H + +#if MIN_VERSION_network(3, 0, 0) +import qualified Network.Socket as Sock +#else import qualified Network.Socket.Internal as Sock +#endif + import Data.CaseInsensitive (CI) import Network.Wai import Network.Wai.Test hiding (assertHeader, assertNoHeader, request) From 3647bf94b791b849a50f5b7d435cd14928a54bad Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 30 Apr 2019 07:03:22 +0300 Subject: [PATCH 12/12] Strip CRs for Windows testing --- yesod-static/test/GeneratorTestUtil.hs | 20 +++++++++++++------- yesod-static/yesod-static.cabal | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/yesod-static/test/GeneratorTestUtil.hs b/yesod-static/test/GeneratorTestUtil.hs index 47dbe251..edf7d322 100644 --- a/yesod-static/test/GeneratorTestUtil.hs +++ b/yesod-static/test/GeneratorTestUtil.hs @@ -8,6 +8,7 @@ import Language.Haskell.TH import Test.HUnit import Yesod.EmbeddedStatic.Types as Y import qualified Data.ByteString.Lazy as BL +import RIO (HasCallStack) -- We test the generators by executing them at compile time -- and sticking the result into the GenTestResult. We then @@ -28,11 +29,15 @@ testEntry name _ _ e | ebHaskellName e /= (mkName Control.Applicative.<$> name) testEntry _ loc _ e | ebLocation e /= loc = [| GenError ("location " ++ $(litE $ stringL $ show $ ebLocation e)) |] testEntry _ _ act e = do - expected <- runIO act - actual <- runIO $ ebProductionContent e + expected <- fmap stripCR $ runIO act + actual <- fmap stripCR $ runIO $ ebProductionContent e if expected == actual then [| GenSuccessWithDevel $(ebDevelReload e) |] - else [| GenError "production content" |] + else [| GenError $ "production content: " ++ $(litE $ stringL $ show (expected, actual)) |] + +-- | Remove all carriage returns, for Windows testing +stripCR :: BL.ByteString -> BL.ByteString +stripCR = BL.filter (/= 13) testOneEntry :: Maybe String -> Y.Location -> IO BL.ByteString -> [Entry] -> ExpQ testOneEntry name loc ct [e] = testEntry name loc ct e @@ -48,12 +53,13 @@ testEntries a b = listE $ zipWith f a' b' f (name, loc, ct) e = testEntry name loc ct e -- | Use this at runtime to assert the 'GenTestResult' is OK -assertGenResult :: (IO BL.ByteString) -- ^ expected development content +assertGenResult :: HasCallStack + => (IO BL.ByteString) -- ^ expected development content -> GenTestResult -- ^ test result created at compile time -> Assertion assertGenResult _ (GenError e) = assertFailure ("invalid " ++ e) assertGenResult mexpected (GenSuccessWithDevel mactual) = do - expected <- mexpected - actual <- mactual + expected <- fmap stripCR mexpected + actual <- fmap stripCR mactual when (expected /= actual) $ - assertFailure "invalid devel content" + assertFailure $ "invalid devel content: " ++ show (expected, actual) diff --git a/yesod-static/yesod-static.cabal b/yesod-static/yesod-static.cabal index 9da53c24..27b26979 100644 --- a/yesod-static/yesod-static.cabal +++ b/yesod-static/yesod-static.cabal @@ -115,6 +115,7 @@ test-suite tests , wai , wai-app-static , yesod-core + , rio ghc-options: -Wall -threaded extensions: TemplateHaskell