diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3b4e355a..7985bb15 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,6 +19,7 @@ jobs: ghc: - "9.4.8" - "9.6.3" + - "9.8.1" os: - "macos-latest" - "ubuntu-latest" @@ -31,7 +32,7 @@ jobs: ghc-version: ${{ matrix.ghc }} - name: Configure - run: cabal configure --ghc-options -Werror + run: cabal configure --enable-tests --ghc-options -Werror - name: Compile run: cabal build lib:shrun diff --git a/README.md b/README.md index 9989461c..463e3cf2 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Using `ghcup`, install `cabal 2.4+` and one of: - `ghc 9.4` - `ghc 9.6` +- `ghc 9.8` ### Build Shrun diff --git a/benchmarks/baseline_ubuntu-latest_9.8.1_ci.csv b/benchmarks/baseline_ubuntu-latest_9.8.1_ci.csv new file mode 100644 index 00000000..5ca4091b --- /dev/null +++ b/benchmarks/baseline_ubuntu-latest_9.8.1_ci.csv @@ -0,0 +1,10 @@ +Name,Mean (ps),2*Stdev (ps),Allocated,Copied,Peak Memory +All.Basic Logging.10_000,424874375,35496180,858557,4866,8388608 +All.Basic Logging.100_000,414872187,34787626,858666,4978,9437184 +All.Basic Logging.1_000_000,418198593,27627318,858769,4816,9437184 +All.Command Logging.10_000,594754062,50058574,977834,6139,9437184 +All.Command Logging.100_000,579419062,41957020,977929,6235,9437184 +All.Command Logging.1_000_000,596570625,46203452,991918,6708,9437184 +All.File Logging.10_000,816050937,46860996,1118291,7041,9437184 +All.File Logging.100_000,822995625,60041220,1118089,7180,9437184 +All.File Logging.1_000_000,801665000,58974894,1117985,7194,9437184 diff --git a/benchmarks/baseline_ubuntu-latest_9.8.1_ci.svg b/benchmarks/baseline_ubuntu-latest_9.8.1_ci.svg new file mode 100644 index 00000000..b31bb24b --- /dev/null +++ b/benchmarks/baseline_ubuntu-latest_9.8.1_ci.svg @@ -0,0 +1,112 @@ + + + +Basic Logging.10_000 +425 μs + + +425 μs ± 35 μs + + + + + + + +Basic Logging.100_000 +415 μs + + +415 μs ± 35 μs + + + + + + + +Basic Logging.1_000_000 +418 μs + + +418 μs ± 28 μs + + + + + + + +Command Logging.10_000 +595 μs + + +595 μs ± 50 μs + + + + + + + +Command Logging.100_000 +579 μs + + +579 μs ± 42 μs + + + + + + + +Command Logging.1_000_000 +597 μs + + +597 μs ± 46 μs + + + + + + + +File Logging.10_000 +816 μs + + +816 μs ± 47 μs + + + + + + + +File Logging.100_000 +823 μs + + +823 μs ± 60 μs + + + + + + + +File Logging.1_000_000 +802 μs + + +802 μs ± 59 μs + + + + + + + + diff --git a/cabal.project b/cabal.project index e6c78b85..cbf7eadd 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ -index-state: 2023-08-28T06:04:10Z +index-state: 2024-02-22T22:24:43Z packages: . @@ -28,17 +28,17 @@ constraints: effects-fs -os_path source-repository-package type: git location: https://github.com/tbidne/algebra-simple.git - tag: 0e7b02ba5b420d7421c8f652aec5d219d0402395 + tag: f4f799cea958fb2b2309d70f47a658dff2481441 source-repository-package type: git location: https://github.com/tbidne/bounds.git - tag: 1d7451a64d38d3998ce647075663fb81fdf34ad4 + tag: 50b07ca118ae140d065ec0285f38e72151da4cad source-repository-package type: git location: https://github.com/tbidne/monad-effects.git - tag: f2d0a6d6fa07f6e3ec44c003487f5eb6b786b254 + tag: 1725ed9812a21c7d3d32f5becc01a2eaab76cc9f subdir: lib/effects-async lib/effects-exceptions @@ -56,14 +56,14 @@ source-repository-package source-repository-package type: git location: https://github.com/tbidne/relative-time.git - tag: e9dbac1861ce4db3e40c8bf5109b1fabfab24c22 + tag: 5f89851baf90c671fffa8d5118e0b37186220fef source-repository-package type: git location: https://github.com/tbidne/si-bytes.git - tag: 8f0de55f84f5324477072939181df5fc520a0e0a + tag: 40f8bc532533340bc69390e75c99faf41e252983 source-repository-package type: git location: https://github.com/tbidne/smart-math.git - tag: 068d8a72b86df3f64fa0bc2df85d1add9f0d47a8 + tag: 2d52207b447d2b25c33488faf9ad6e7417f4d454 diff --git a/flake.lock b/flake.lock index 3b4b773b..e8089b9f 100644 --- a/flake.lock +++ b/flake.lock @@ -13,11 +13,11 @@ ] }, "locked": { - "lastModified": 1692416519, - "narHash": "sha256-QujYqWQDlRUSpaXosMBm0Ae0Min+uXOrQvIjo9pidFs=", + "lastModified": 1704945810, + "narHash": "sha256-NXTZLwilM1KyqUh5inJVm4+Yev9gnMSr4anuFj5dsD4=", "owner": "tbidne", "repo": "algebra-simple", - "rev": "0e7b02ba5b420d7421c8f652aec5d219d0402395", + "rev": "f4f799cea958fb2b2309d70f47a658dff2481441", "type": "github" }, "original": { @@ -39,11 +39,11 @@ ] }, "locked": { - "lastModified": 1692416981, - "narHash": "sha256-cRXLPzvpRS8RAKNxHmBA0a+kTICxioVLJUvN+cVQ+WM=", + "lastModified": 1705009486, + "narHash": "sha256-TZhpDX9z6tOFfomFjRJLlgHEqT2JcwxxurG1KTenY04=", "owner": "tbidne", "repo": "bounds", - "rev": "1d7451a64d38d3998ce647075663fb81fdf34ad4", + "rev": "50b07ca118ae140d065ec0285f38e72151da4cad", "type": "github" }, "original": { @@ -92,11 +92,11 @@ ] }, "locked": { - "lastModified": 1701252470, - "narHash": "sha256-tR/NUY0YcThnm2vnP4PDnIqIMhmbOI2nz7czvAwJzOE=", + "lastModified": 1704667169, + "narHash": "sha256-YxYZjAneaFaquhAyeNy2T83JzIlCnDgVsp54sHhWnWQ=", "owner": "tbidne", "repo": "monad-effects", - "rev": "f2d0a6d6fa07f6e3ec44c003487f5eb6b786b254", + "rev": "1725ed9812a21c7d3d32f5becc01a2eaab76cc9f", "type": "github" }, "original": { @@ -173,11 +173,11 @@ ] }, "locked": { - "lastModified": 1692432568, - "narHash": "sha256-nvp5QBa4xFL5vqmb3z8DnhicjYIgClrSX1lKdGyrdZ8=", + "lastModified": 1702858257, + "narHash": "sha256-9sbD2wm0Y6qTQMRhlMLtJ6rVSB4mgqa5ZtEJFrsoo8Q=", "owner": "tbidne", "repo": "relative-time", - "rev": "e9dbac1861ce4db3e40c8bf5109b1fabfab24c22", + "rev": "5f89851baf90c671fffa8d5118e0b37186220fef", "type": "github" }, "original": { @@ -218,11 +218,11 @@ ] }, "locked": { - "lastModified": 1692431484, - "narHash": "sha256-zVneM1kjmsTEOu8703l0+INBp2gs67UR5mzNVdULRNs=", + "lastModified": 1705011829, + "narHash": "sha256-EtQpSyoN+jx1SCoU9SCnwLkeVjD+720nP5IlLvXcEIc=", "owner": "tbidne", "repo": "si-bytes", - "rev": "8f0de55f84f5324477072939181df5fc520a0e0a", + "rev": "40f8bc532533340bc69390e75c99faf41e252983", "type": "github" }, "original": { @@ -250,11 +250,11 @@ ] }, "locked": { - "lastModified": 1692417671, - "narHash": "sha256-AKCmHKBerj4WqwjQWBvhPoH/9nu4jc/fMuXawBT+NgQ=", + "lastModified": 1705092434, + "narHash": "sha256-/chCL/sDFT7pamzTLovLHNO6FRPRU7CeycVftC2w+cY=", "owner": "tbidne", "repo": "smart-math", - "rev": "068d8a72b86df3f64fa0bc2df85d1add9f0d47a8", + "rev": "2d52207b447d2b25c33488faf9ad6e7417f4d454", "type": "github" }, "original": { diff --git a/shrun.cabal b/shrun.cabal index 47d804d1..9ce25fee 100644 --- a/shrun.cabal +++ b/shrun.cabal @@ -3,7 +3,7 @@ name: shrun version: 0.8.1 license: MIT license-file: LICENSE -tested-with: GHC ==9.4.8 || ==9.6.3 +tested-with: GHC ==9.4.8 || ==9.6.3 || ==9.8.1 copyright: 2021-2023 Thomas Bidne author: Thomas Bidne maintainer: tbidne@protonmail.com @@ -82,11 +82,11 @@ library Shrun.Utils build-depends: - , base >=4.17 && <4.19 - , bytestring >=0.10.12 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.12 && <0.13 , concurrent-output ^>=1.10.7 - , containers ^>=0.6.2.1 - , dbus ^>=1.2.14 + , containers >=0.6.2.1 && <0.8 + , dbus >=1.2.14 && <1.4 , effects-async ^>=0.1 , effects-env ^>=0.1 , effects-exceptions ^>=0.1 @@ -108,8 +108,8 @@ library , pretty-terminal ^>=0.1 , relative-time ^>=0.1 , si-bytes ^>=0.1 - , template-haskell >=2.17.0.0 && <2.21 - , text >=1.2.3.2 && <2.1 + , template-haskell >=2.17.0.0 && <2.22 + , text >=1.2.3.2 && <2.2 , toml-reader >=0.2.0.0 && <0.3.0.0 , unordered-containers ^>=0.2.9.0 @@ -160,7 +160,7 @@ test-suite unit , optparse-applicative , shrun , si-bytes - , tasty >=1.1.0.3 && <1.5 + , tasty >=1.1.0.3 && <1.6 , tasty-hedgehog >=1.2.0.0 && <1.5 , tasty-hunit >=0.9 && <0.11 , text diff --git a/test/integration/Integration/Failures.hs b/test/integration/Integration/Failures.hs index 1a488992..ad57df8d 100644 --- a/test/integration/Integration/Failures.hs +++ b/test/integration/Integration/Failures.hs @@ -4,6 +4,7 @@ module Integration.Failures (specs) where import Control.Exception (IOException) +import Data.List qualified as L import Data.Text qualified as T import Effects.Exception (StringException) import Integration.Prelude @@ -37,12 +38,16 @@ missingConfig = testCase "Missing explicit config throws exception" $ do case result of Nothing -> assertFailure "Expected exception" - Just ex -> expectedErr @=? displayException ex + Just ex -> do + let exMsg = displayException ex + assertBool ("Exception: " ++ exMsg) (expectedStart `L.isPrefixOf` displayException ex) + assertBool ("Exception: " ++ exMsg) (expectedEnd `L.isSuffixOf` displayException ex) logs <- readIORef logsRef logs @=? [] where - expectedErr = "bad-file.toml: openFdAt: does not exist (No such file or directory)" + expectedStart = "bad-file.toml" + expectedEnd = "does not exist (No such file or directory)" duplicateKeys :: TestTree duplicateKeys = testCase "Duplicate keys throws exception" $ do