An issue with the "Hello Test" tutorial

After successfully passing the Hello Holo tutorial :tada:, I started with the Hello Test tutorial. After I adjusted the code in the index.js file and executed “hc test”, I got the following error message:

[nix-shell:~/holochain/core_concepts/cc_tuts]$ hc test
Packaging files for testing to file: “/home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json”

cargo build --release --target=wasm32-unknown-unknown --target-dir=…/target
Finished release [optimized] target(s) in 0.12s
cargo build --release --target=wasm32-unknown-unknown --target-dir=…/target
Finished release [optimized] target(s) in 0.11s
Created DNA package file at “/home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json”
DNA hash: QmPRuKcQKfbYM8fiua8eSSAxomDHH1Tyc5Mpk1mRHakWxw
Running tests in test/index.js
node test/index.js
/home/vagrant/holochain/core_concepts/cc_tuts/test/index.js:28
),
^

SyntaxError: Unexpected token )
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11
Error: command node test/index.js was not successful

Did I not execute the command in the correct directory?

Looks fine to me. Could you paste the output of cc_tuts/test/index.js? Looks like just a simple syntax issue, maybe caused by copy/paste?

Hmm let me check this. Looks like it doesn’t like the ), which is strange.
Maybe add your index.js as Paul said so we can double check.

Hi @pauldaoust you were right. It was actually a simple copy/paste error in the index.js. I’m sorry :sweat_smile:

This time the test run looked much better. Nevertheless I got an error message again:

[nix-shell:~/holochain/core_concepts/cc_tuts]$ hc test
Packaging files for testing to file: “/home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json”

cargo build --release --target=wasm32-unknown-unknown --target-dir=…/target
Finished release [optimized] target(s) in 0.11s
cargo build --release --target=wasm32-unknown-unknown --target-dir=…/target
Finished release [optimized] target(s) in 0.12s
Created DNA package file at “/home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json”
DNA hash: QmPRuKcQKfbYM8fiua8eSSAxomDHH1Tyc5Mpk1mRHakWxw
Running tests in test/index.js
node test/index.js
08:44:36 [try-o-rama] debug: About to execute 1 tests
TAP version 13

Test hello holo

08:44:36 [try-o-rama: player combined] debug: spawning
08:44:36 [try-o-rama] info: Using conductor path: holochain
08:44:36 [try-o-rama] info: Holochain version: holochain 0.0.34-alpha1

08:44:36 info:
☉☉☉ [[[CONDUCTOR combined]]]
☉ Using config path: /tmp/tmp.tTt1cS5Zj5/try-o-rama/B8X1ST/conductor-config.toml

08:44:36 info:
★★★ [[[CONDUCTOR combined]]]
★ Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json

08:44:36 info:
:yin_yang::yin_yang::yin_yang: [[[CONDUCTOR combined]]]
:yin_yang: Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json
:yin_yang:
08:44:36 info:
:wheel_of_dharma::wheel_of_dharma::wheel_of_dharma: [[[CONDUCTOR combined]]]
:wheel_of_dharma: Unlocking agent keys:
:wheel_of_dharma: Unlocking key for agent ‘cc_tuts–alice’:
:wheel_of_dharma:
08:44:37 info:
:peace_symbol::peace_symbol::peace_symbol: [[[CONDUCTOR combined]]]
:peace_symbol: Unlocking key for agent ‘cc_tuts–bob’:
:peace_symbol:
08:44:38 info:
☉☉☉ [[[CONDUCTOR combined]]]
☉ conductor: boot_from_config
☉ Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json

08:44:38 info:
★★★ [[[CONDUCTOR combined]]]
★ Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json

08:44:38 info:
:yin_yang::yin_yang::yin_yang: [[[CONDUCTOR combined]]]
:yin_yang: Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json
:yin_yang:
08:44:38 info:
:wheel_of_dharma::wheel_of_dharma::wheel_of_dharma: [[[CONDUCTOR combined]]]
:wheel_of_dharma: Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json
:wheel_of_dharma:
08:44:38 info:
:peace_symbol::peace_symbol::peace_symbol: [[[CONDUCTOR combined]]]
:peace_symbol: conductor: build_conductor_api instance_id=cc_tuts–alice, config=Configuration { agents: [AgentConfiguration { id: “cc_tuts–alice”, name: “combined::cc_tuts::ce17d2f8-d0e7-4dbd-ae46-fccfd5c418a4–alice”, public_address: “HcScJk33ete7EFi5sz57qpKZ9n4rcvxj3793gD6aR6me6xV8hhMstAcz3geib3z”, keystore_file: “[UNUSED]”, holo_remote_key: None, test_agent: Some(true) }, AgentConfiguration { id: “cc_tuts–bob”, name: “combined::cc_tuts::ce17d2f8-d0e7-4dbd-ae46-fccfd5c418a4–bob”, public_address: “[SHOULD BE REWRITTEN]”, keystore_file: “[UNUSED]”, holo_remote_key: None, test_agent: Some(true) }], dnas: [DnaConfiguration { id: “cc_tuts”, file: “/home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json”, hash: “QmPRuKcQKfbYM8fiua8eSSAxomDHH1Tyc5Mpk1mRHakWxw”, uuid: Some(“ce17d2f8-d0e7-4dbd-ae46-fccfd5c418a4”) }], instances: [InstanceConfiguration { id: “cc_tuts–alice”, dna: “cc_tuts”, agent: “cc_tuts–alice”, storage: File { path: “/tmp/tmp.tTt1cS5Zj5/try-o-rama/B8X1ST/cc_tuts–alice” } }, InstanceConfiguration { id: “cc_tuts–bob”, dna: “cc_tuts”, agent: “cc_tuts–bob”, storage: File { path: “/tmp/tmp.tTt1cS5Zj5/try-o-rama/B8X1ST/cc_tuts–bob” } }], interfaces: [InterfaceConfiguration { id: “try-o-rama-admin-interface”, driver: Websocket { port: 36159 }, admin: true, instances: [] }, InterfaceConfiguration { id: “try-o-rama-zome-interface”, driver: Websocket { port: 33935 }, admin: false, instances: [InstanceReferenceConfiguration { id: “cc_tuts–alice”, alias: None }, InstanceReferenceConfiguration { id: “cc_tuts–bob”, alias: None }] }], bridges: [], ui_bundles: [], ui_interfaces: [], logger: LoggerConfiguration { logger_level: “debug”, rules: LogRules { rules: [LogRule { pattern: .*, exclude: true, color: None }] }, state_dump: false }, network: Some(Sim2h(Sim2hConfig { sim2h_url: “wss://sim2h.holochain.org:9000” })), persistence_dir: “/tmp/tmp.tTt1cS5Zj5/try-o-rama/B8X1ST”, signing_service_uri: None, encryption_service_uri: None, decryption_service_uri: None, dpki: None, signals: SignalConfig { trace: false, consistency: true }, passphrase_service: Cmd }
:peace_symbol:
08:44:38 info:
☉☉☉ [[[CONDUCTOR combined]]]
☉ Reading DNA from /home/vagrant/holochain/core_concepts/cc_tuts/dist/cc_tuts.dna.json

08:44:38 info:
★★★ [[[CONDUCTOR combined]]]
★ Failed to load instance cc_tuts–alice from storage: ErrorGeneric(“State could not be loaded due to NoneError”)
★ Initializing new chain…

08:44:38 error:
:yin_yang::yin_yang::yin_yang: {{{CONDUCTOR combined}}}
:yin_yang: WARNING! The git-hash of the runtime and the zome don’t match.
:yin_yang: Runtime hash: 9388be345fc13e5f2b62ab68f1df62691e6d2891
:yin_yang: Zome hash:
:yin_yang:

Any ideas?

1 Like

I also get these warnings / errors.
Unfortunately the test logging is pretty noisy but I have found that it doesn’t prevent the tests from working.
Does yours finish and pass?

On a side note, I think Failed to load instance cc_tuts–alice from storage: ErrorGeneric(“State could not be loaded due to NoneError”) is fixed recently and will come out on a new release soon.

No, my tests weren’t finished. They stopped at the point I posted. After a while I stopped…

I have two other questions! Just for my understanding:

  1. When I start Vagrant, it should automatically create a “Shared File” /vagrant, shouldn’t it? But it looks like this didn’t happen?!

  2. The versions of Nix (2.0 instead of 2.2.2) or holochain (0.0.34-alpha1 instead of 0.0.35-alpha7) don’t seem to update automatically?!

Is there something wrong?
Thank you very much for your everlasting support

Are you using in memory tests or sim2h? I’ve noticed in memory can take a little while to finish.

I’m not sure about the shared file. I think it’s should be created automatically but I will check this.

As for the versions. That version of nix is correct. It might be wrong on the install page.
The holochain version will be automatically updated as you enter nix-shell however we are still fixing some things to get the next release out to holonix.

Maybe try running the tests with sim2h and see if it finishes. If it doesn’t something else might be wrong.

I´m using sim2h as I could see in my index.js file:

Maybe something in the index.js file is wrong?

I also could find out, that there is no problem with the /vagrant shared file. You was right, it´s automatically created!

YES!!! I did it!!! :fireworks: Amazing, it worked!

The error must have been somewhere in the index.js file. I just did the tutorial from the beginning and rewrote the index.js file and that was the result:

Many thanks for your help!
Now it’s time for the GUI tutorial!!

1 Like