From 143cf07cc024f186830dec6943e40d499e2f63b4 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 18 Jul 2024 23:09:22 +0200 Subject: [PATCH] ci: fix flake checks --- flake.nix | 23 ++++++++++++----------- nix/ci-overlay.nix | 2 ++ nix/nvim-plugin-overlay.nix | 26 -------------------------- spec/hspec_spec.lua | 2 ++ spec/runner_spec.lua | 1 + spec/sydtest_spec.lua | 2 ++ spec/tasty_spec.lua | 2 ++ 7 files changed, 21 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index be7d3f0..cc576bb 100644 --- a/flake.nix +++ b/flake.nix @@ -117,24 +117,25 @@ }; }; - devShell = pkgs.mkShell { + devShell = pkgs.nvim-nightly-test.overrideAttrs (oa: { name = "neotest-haskell devShell"; shellHook = '' ${pre-commit-check.shellHook} ln -fs ${pkgs.luarc-to-json luarc-nightly} .luarc.json + export NEOTEST_HASKELL_DEV_DIR=${pkgs.neotest-haskell-dev} + export TREE_SITTER_HASKELL_DIR=${pkgs.tree-sitter-haskell-plugin} + # FIXME: Needed by neotest + export PLENARY_DIR=${pkgs.vimPlugins.plenary-nvim} ''; buildInputs = - (with pkgs; [ - zlib - ]) - ++ (with git-hooks.packages.${system}; [ - alejandra + self.checks.${system}.pre-commit-check.enabledPackages + ++ (with pkgs; [ lua-language-server - stylua - editorconfig-checker - markdownlint-cli - ]); - }; + ]) + ++ oa.buildInputs + ++ oa.propagatedBuildInputs; + doCheck = false; + }); docgen = pkgs.callPackage ./nix/docgen.nix {}; in { diff --git a/nix/ci-overlay.nix b/nix/ci-overlay.nix index a2bcb26..b97d4a9 100644 --- a/nix/ci-overlay.nix +++ b/nix/ci-overlay.nix @@ -29,6 +29,7 @@ # These have to be on the rtp for queries to work export NEOTEST_HASKELL_DEV_DIR=${final.neotest-haskell-dev} export TREE_SITTER_HASKELL_DIR=${tree-sitter-haskell-plugin} + export PLENARY_DIR=${final.vimPlugins.plenary-nvim} ''; }; in { @@ -37,4 +38,5 @@ in { name = "nvim-nightly-test"; nvim = final.neovim-nightly; }; + inherit tree-sitter-haskell-plugin; } diff --git a/nix/nvim-plugin-overlay.nix b/nix/nvim-plugin-overlay.nix index 83fcc9e..7bf4e2c 100644 --- a/nix/nvim-plugin-overlay.nix +++ b/nix/nvim-plugin-overlay.nix @@ -34,32 +34,6 @@ propagatedBuildInputs = [luarocks-build-treesitter-parser]; }) {}; - neotest = luaself.callPackage ({ - buildLuarocksPackage, - fetchurl, - fetchzip, - lua, - luaOlder, - nvim-nio, - plenary-nvim, - }: - buildLuarocksPackage { - pname = "neotest"; - version = "5.2.3-1"; - knownRockspec = - (fetchurl { - url = "mirror://luarocks/neotest-5.2.3-1.rockspec"; - sha256 = "16pwkwv2dmi9aqhp6bdbgwhksi891iz73rvksqmv136jx6fi7za1"; - }) - .outPath; - src = fetchzip { - url = "https://github.com/nvim-neotest/neotest/archive/5caac5cc235d495a2382bc2980630ef36ac87032.zip"; - sha256 = "1i1d6m17wf3p76nm75jk4ayd4zyhslmqi2pc7j8qx87391mnz2c4"; - }; - disabled = luaOlder "5.1"; - propagatedBuildInputs = [lua nvim-nio plenary-nvim]; - }) {}; - neotest-haskell = luaself.callPackage ({ buildLuarocksPackage, fetchurl, diff --git a/spec/hspec_spec.lua b/spec/hspec_spec.lua index 75c2a6d..bba078b 100644 --- a/spec/hspec_spec.lua +++ b/spec/hspec_spec.lua @@ -1,5 +1,7 @@ +vim.env.PLENARY_TEST_TIMEOUT = 60000 vim.opt.runtimepath:append(vim.env.NEOTEST_HASKELL_DEV_DIR) vim.opt.runtimepath:append(vim.env.TREE_SITTER_HASKELL_DIR) +vim.opt.runtimepath:append(vim.env.PLENARY_DIR) local compat = require('neotest-haskell.compat') local hspec = require('neotest-haskell.hspec') diff --git a/spec/runner_spec.lua b/spec/runner_spec.lua index e858c21..56a8e95 100644 --- a/spec/runner_spec.lua +++ b/spec/runner_spec.lua @@ -1,3 +1,4 @@ +vim.env.PLENARY_TEST_TIMEOUT = 60000 local runner = require('neotest-haskell.runner') local async = require('nio').tests diff --git a/spec/sydtest_spec.lua b/spec/sydtest_spec.lua index f8794cf..0635988 100644 --- a/spec/sydtest_spec.lua +++ b/spec/sydtest_spec.lua @@ -1,5 +1,7 @@ +vim.env.PLENARY_TEST_TIMEOUT = 60000 vim.opt.runtimepath:append(vim.env.NEOTEST_HASKELL_DEV_DIR) vim.opt.runtimepath:append(vim.env.TREE_SITTER_HASKELL_DIR) +vim.opt.runtimepath:append(vim.env.PLENARY_DIR) local sydtest = require('neotest-haskell.sydtest') local compat = require('neotest-haskell.compat') diff --git a/spec/tasty_spec.lua b/spec/tasty_spec.lua index df828e5..ced0d19 100644 --- a/spec/tasty_spec.lua +++ b/spec/tasty_spec.lua @@ -1,5 +1,7 @@ +vim.env.PLENARY_TEST_TIMEOUT = 60000 vim.opt.runtimepath:append(vim.env.NEOTEST_HASKELL_DEV_DIR) vim.opt.runtimepath:append(vim.env.TREE_SITTER_HASKELL_DIR) +vim.opt.runtimepath:append(vim.env.PLENARY_DIR) local tasty = require('neotest-haskell.tasty') local compat = require('neotest-haskell.compat')