Tryorama error when running `npm test`

I seem to be having an issue with tryorama when running the test script, although the issue seems to be isolated to the developer exercises repository (see debugging efforts below). I am working on a linux machine.

Here is what I did:

  • cloned holochain-gym/developer-exercises repository
  • ran nix-shell in root folder
  • navigated to solution folder for various 1.basics exercises
  • ran npm install and npm test
  • zomes built into wasm and dna packaged fine
  • got the following error:
12:13:16 [tryorama] info: Conductor 'c0' process spawning completed.
App Port spun up on port  39335
12:13:17 [tryorama] error: Test error: "TypeError: Cannot read property '0' of undefined\n" +
  '    at Conductor._makeInstalledAgentHapp (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/@holochain/tryorama/src/conductor.ts:233:55)\n' +
  '    at Conductor.<anonymous> (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/@holochain/tryorama/src/conductor.ts:229:17)\n' +
  '    at Generator.next (<anonymous>)\n' +
  '    at fulfilled (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/@holochain/tryorama/lib/conductor.js:24:58)\n' +
  '    at processTicksAndRejections (internal/process/task_queues.js:97:5)'
not ok 1 Test threw an exception. See output for details.
  ---
    operator: fail
    at: <anonymous> (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/@holochain/tryorama/src/middleware.ts:137:13)
    stack: |-
      Error: Test threw an exception. See output for details.
          at Test.assert [as _assert] (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/tape/lib/test.js:304:54)
          at Test.bound [as _assert] (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/tape/lib/test.js:91:32)
          at Test.fail (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/tape/lib/test.js:398:10)
          at Test.bound [as fail] (/home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/tape/lib/test.js:91:32)
          at /home/wesley/2_Areas/programming/developer-exercises/1.basic/3.links/solution/tests/node_modules/@holochain/tryorama/src/middleware.ts:137:13
          at processTicksAndRejections (internal/process/task_queues.js:97:5)
  ...
12:13:17 [tryorama] info: conductor 'c0' exited with code null
FIXME: ignoring onLeave

1..1
# tests 1
# pass  0
# fail  1

npm ERR! Test failed.  See above for more details.

debugging efforts:

Any ideas what could be causing this testing error or what the error means?

1 Like

Yeah it seems there are issues with the solutions in the gym. Those errors seem to indicate a bad tryorama version.

1 Like

I also get the same issue when running the test in the exercise folder as well. But I’ll see if I can figure out how to change the tryorama version. Will comment any updates :slight_smile:

1 Like

I do not know if this can help as I get the same error for the basic exercises running the test with the version 4.3 of Tryorama. When I use the version 4.1, I can run the tests without any problem using nix-shell 2.3.12 (I have not tried the 4.1 call under 2.3.14). It seems related to an import error

“Error while importing \“env\”.\”_import
_data\": incompatible import type. Expected Function(FunctionType { params: [i32], results: []}) but received Function(FuntionType {params: [], results: [i64]})")

Maybe you already seen those details, maybe it can be related to the version of TypeScript as well. Just sharing what I got on my side.

Hello @Pegarissimo . How do you do?

I began the HoloGym and I encountered the same import error feedback when compiling 0.zome-functions/exercice/tests.

I’d really like to continue with the gym; So, what can I do to avoid this error feedback that i suspect to come again and again.

Many thanks upfront.

Mmm hi there! @Unshambles @Pegarissimo this error looks like a mismatch of versions between the hdk with which you compile the exercises code and the actual holochain binary executing them.

Did you by any chance initiate the nix-shell like this? nix-shell https://nightly.holochain.love? If so, this is the wrong way to do it. As explained in the setup section of the gym, you need to navigate to the root folder of the developer-exercises repository and run nix-shell . there. That will guarantee that versions match.

If that’s not the error, then it seems that the gym is not working well for you while it’s working allright in CI… Which would be a bit worrying.

Hi @guillemcordoba . Thank you for this quick answer. :slight_smile:

Yes, i unfortunately did it the first way : nix-shell https://nightly.holochain.love. It is quite confusing since there’s 2 different “how-to”:

one on the page : Install Holochain - Holochain Docs

and another on the page : Requirements: Setup: Holochain Gym.

I uninstall and reinstall holochain and give you a feedback

Thanks again

I know… The thing is this is how this is supposed to work: this is my proposed addition to the holochain docs: Install Holochain - Holochain Docs

Does that explanation make sense?

2 Likes

Yes! It really makes sense. Good to have this comment added.

And I think it will even be more efficient if it’s placed at the beginning of the “installing Holochain dev tools” topic. I say that, because many people won’t read until the very end before installation. If they don’t, they will have to uninstall, then reinstall…

Or it would maybe make sense to explain the 2 different ways to install it :

way 1) last holochain release, in wich cases

way 2) pinned holochain version, in wich other cases.

to go back to our topic, I uninstalled - reinstalled nix-shell, but I still have the same error feedback.

I will completely reinstall Ubuntu tomorrow and try again to be sure it doesn’t come from a bad uninstall. I’ll keep you posted @guillemcordoba

Hi, if this can help : I start the nix-shell in dev-exercise to take the default.nix ( I don’t use the holcgain.love for exercises. I made a few virtual machines: my oldest one using nix-shell xx.12 is working great and still using it today :+1: (if you ever need a reference). The new installations I did after that are using nix-shell xx.14, and I get thoses errors. I saw that my old version is calling the tryorame 4.1 (but it says tap 13 in the test results, so I presume it is actually using version 4.13 as well). So the rep that I cloned about a little more than a month works great. If there any details or test you need, just let me know and it will be a pleasure

Mmm forgive me but I don’t understand what you mean by nix-shell xx.12. The CI for the gym seems to run correctly: Merge pull request #41 from GuiuMateu/main · holochain-gym/developer-exercises@23061f6 · GitHub. What environment are you in? Is this using Windows and WSL? Do you have the latest version of the developer-exercises repository?

I understand no worries (plus my holo rookie factor on top of it).

My working gyms exercises were cloned about a month ago. When I run nix-shell, It says it uses the nix-shell version 2.3.12, holocain 0.0.100 and CI 0.0.1-dev.0.

The new installations were done lately (last time dates fro. 2 days ago), using the latest repo of the gym exercises. When I run nix-shell, it shows the 2.3.14 version of the nix-shell, the holochain and client are the same as the other one (0.0.100 / 0.0.0.1-dev.0)

I’m running virtual boxes under windows 10 (I did have a wsl 2 installation on different machine, it did the same result.).

And to enter the nix-shell you ran the nix-shell command in the root folder of the latest version of the exercises repository?

Yes, I do run nix-shell from the exercise folder

1 Like

Okey omg so sorry about this. I was relying on the CI of the Gym, but that had a bug in itself that didn’t surface its errors…

Anyway, retested everything, and pushed a working version for all the exercises.

Pull the developer-exercises repo again and try it now. You should be able to continue your Gym journey now.

1 Like

Cool! I clone the new repo this morning and everything works great :slightly_smiling_face::+1:, thanks!

2 Likes

Hi @guillemcordoba.

Many thanks for your explanations. I completely reinstalled Ubuntu and nix the way you said and it worked. :grinning::handshake:
From now I can continue Holochain Gym.

Read you soon.

2 Likes