Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when updating hspec to 2.9.0, must change configFastFail to configFailFast #1058

Open
GoldThruster opened this issue Mar 25, 2022 · 13 comments

Comments

@GoldThruster
Copy link

GoldThruster commented Mar 25, 2022

My test wasn't compiling (which has not be modified at all, fresh from download), and cabal reported this error:

test\Tests.hs:9:27: error:
    Module `Test.Hspec.Runner' does not export `configFastFail'
9 | import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
  |                           ^^^^^^^^^^^^^^

Searching online I found the hspec changelog (the latest version).
It reports that in version "2.9.0":

Changes in 2.9.0
- Add ASCII fallbacks to "checks" formatter (fixes #512)
- Use checks formatter by default (to restore the old behavior use --format specdoc)
- Allow to extend the list of available formatters for --format (configAvailableFormatters)
- Add getExpectedTotalCount to Test.Hspec.Core.Formatters.V2
- Rename formatConfigItemCount to formatConfigExpectedTotalCount
- Rename configFastFail to configFailFast      <--!!!!

The important line: "Rename configFastFail to configFailFast"
By updating the import, everything compiled just fine.

I'm not making a pr because, no one else seems to have reported it, so I'm not sure I've messed up something or is a real "bug".
If I haven't messed up, then the only corrections to be applied are:

  • import Test.Hspec.Runner (configFailFast, defaultConfig, hspecWith) on line 9
  • main = hspecWith defaultConfig {configFailFast = True} specs on line 14
@petertseng petertseng changed the title Bug 🐞 - "Test.hs" is not up-to date when updating hspec to 2.9.0, must change configFastFail to configFailFast May 5, 2022
@moniquelive
Copy link

If you like oneliners like me, change to the exercise path and:

❯ sed -i 's/configFastFail/configFailFast/g' test/Tests.hs

Thanks for pointing that out!

@asarkar
Copy link

asarkar commented Jan 10, 2023

Hard coding configuration options in tests can be avoided by putting a .hspec file in the exercise directory.

In fact, the main function can be completely eliminated as specified in ticket #1075

@denismaier
Copy link

denismaier commented May 2, 2023

What's the status of this? I just ran into the same issue with the pangram exercise. (I'm doing the exercises in the online editor, so I think I cannot adjust the test files manually.)

Edit: I've realized there's a PR for this. I've restated my question there.

@avysk
Copy link

avysk commented May 2, 2023

Can you point me to the PR, please? I've just hit the same error (and this bug is over one month old).

@MatthijsBlom
Copy link
Contributor

The problem is that #1158 isn't merged yet; working on it as we speak.

@avysk
Copy link

avysk commented May 2, 2023

So PR was merged, and my error changed to

[blah]
[2 of 2] Compiling Paths_space_age
Linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.6.3.0/build/test/test ...
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
[blah]

So it looks like the infrastructure is still broken, and CI allowed to merge a broken PR. Am I wrong?

@avysk
Copy link

avysk commented May 2, 2023

...and now I cannot build locally anymore with clock > error: gcc: error: unrecognized command-line option '--target=x86_64-portbld-freebsd--lflag=--target=x86_64-portbld-freebsd'. Isn't the space missing before --lflag?

@MatthijsBlom
Copy link
Contributor

Please open a forum thread and post your system information and taken actions there.

@avysk
Copy link

avysk commented May 2, 2023

How my system information relates to ld failure at Exercism site (see above)? The fact that local build started to fail is just an additional information and can be ignored.

@MatthijsBlom
Copy link
Contributor

Silliness on my part aside, I do not suggest you post on the forum without reason.

Discussions on the forum suggest the problems related to the GHC 9.0.2 -> 9.2.7 upgrade have been fixed. If you are still having trouble, probably something else is going on and please take it to the forum.

@denismaier
Copy link

I've been just able to successfully run a test in the online editor.

@avysk
Copy link

avysk commented May 3, 2023

Yes, it looks like linker error on exercism site was fixed. My tests passed.

@avysk
Copy link

avysk commented May 3, 2023

and just FYI: I have fixed the local build by switching ghc from the usage of gcc to the usage of clang. Quite possible that gcc in FreeBSD is broken somehow, and clang is a part of the base system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants