Skip to content

Testdata directory not included in Hackage release for HLS-Retrie Plugin #3807

Closed
@Vekhir

Description

@Vekhir

The HLS-retrie plugin doesn't include the test/testdata directory within the Hackage release version. See also the src/ directory on Hackage. This issue exists since v1.0.4.0 (where I encountered the issue), but afaict persists through the latest 2.2.0.0 release.

The tests try to find the test/testdata directory, but if it's not included, then it cannot be found.

Your environment

OS: Arch Linux
Kernel: 6.4.12-arch1-1
GHC: 9.0.2 (official package)
haskell-hls-retrie-plugin: 1.0.4.0 (tested; all versions since are affected)

HLS-retrie-plugin is the version as released on Hackage

Steps to reproduce

Build hls-retrie-plugin with tests enabled
Commandline:

  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
    --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
    --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
    --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
    --ghc-option='-pie'

  runhaskell Setup build $MAKEFLAGS
  runhaskell Setup register --gen-script
  runhaskell Setup unregister --gen-script
  sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
  sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh

Then run the tests

  runhaskell Setup test --show-details=direct

Expected behaviour

Tests should pass

Actual behaviour

Tests fail with message

Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}

Debug information (Full Error Log)

Running 1 test suites...
Test suite tests: RUNNING...
Retrie
  Inline this
    provider
      lhs:                                Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/lhs/' to rerun this test only.
      identifier:                         Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/provider.identifier/' to rerun this test only.
      imported identifier:                FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/imported identifier/' to rerun this test only.
      nested where:                       FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/provider.nested where/' to rerun this test only.
      nested let:                         FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/provider.nested let/' to rerun this test only.
      class member:                       FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/class member/' to rerun this test only.
      operator:                           FAIL
        Exception: Language server unexpectedly terminated
        Use -p '/provider.operator/' to rerun this test only.
    command
      top level function:                 Error while initializing: ResponseError {_code = InternalError, _message = "Error on initialize: /build/haskell-hls-retrie-plugin/src/hls-retrie-plugin-1.0.4.0/test/testdata: changeWorkingDirectory: does not exist (No such file or directory)", _xdata = Nothing}
FAIL (7.77s)
        Language server unexpectedly terminated
        Use -p '$0=="Retrie.Inline this.command.top level function"' to rerun this test only.
      top level function in another file: FAIL (4.54s)
        Language server unexpectedly terminated
        Use -p '/top level function in another file/' to rerun this test only.
      nested where function:              FAIL (5.83s)
        Language server unexpectedly terminated
        Use -p '/nested where function/' to rerun this test only.
      nested let function:                FAIL (3.90s)
        Language server unexpectedly terminated
        Use -p '/nested let function/' to rerun this test only.
      operator:                           FAIL (3.26s)
        Language server unexpectedly terminated
        Use -p '/command.operator/' to rerun this test only.

12 out of 12 tests failed (7.77s)
Test suite tests: FAIL
Test suite logged to: dist/test/hls-retrie-plugin-1.0.4.0-tests.log
0 of 1 test suites (0 of 1 test cases) passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triagetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions