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

unable to npm test with a recent holonix #52

Open
mhuesch opened this issue Feb 26, 2021 · 3 comments
Open

unable to npm test with a recent holonix #52

mhuesch opened this issue Feb 26, 2021 · 3 comments

Comments

@mhuesch
Copy link

mhuesch commented Feb 26, 2021

hi! it's quite possible I did something wrong, but I was hoping someone could point me in the right direction.

in the repo root for a checkout of 11afbc4d171d0930ff409343a9727b3ba9ffa274 from my branch (which just adds a pinned holonix shell.nix and then includes a file update from npm test).

$ nix-shell
<... clipped ...>

[nix-shell:~/projects/elemental-chat]$ CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown
    Updating git repository `https://github.com/holochain/holochain.git`
   Compiling fixt v0.0.1 (https://github.com/holochain/holochain.git?rev=0936025e957056bde8ad5a683fa18d91c71d46fc#0936025e)
   Compiling holo_hash v0.0.1 (https://github.com/holochain/holochain.git?rev=0936025e957056bde8ad5a683fa18d91c71d46fc#0936025e)
   Compiling holochain_zome_types v0.0.1 (https://github.com/holochain/holochain.git?rev=0936025e957056bde8ad5a683fa18d91c71d46fc#0936025e)
   Compiling hdk3_derive v0.0.1 (https://github.com/holochain/holochain.git?rev=0936025e957056bde8ad5a683fa18d91c71d46fc#0936025e)
   Compiling hdk3 v0.0.1 (https://github.com/holochain/holochain.git?rev=0936025e957056bde8ad5a683fa18d91c71d46fc#0936025e)
   Compiling elemental-chat v0.0.1-alpha14 (/home/mhueschen/projects/elemental-chat/zomes/chat)
    Finished release [optimized] target(s) in 2m 54s

[nix-shell:~/projects/elemental-chat]$ dna-util -c elemental-chat.dna.workdir

[nix-shell:~/projects/elemental-chat]$ cd tests/

[nix-shell:~/projects/elemental-chat/tests]$ npm install
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

updated 7 packages and audited 212 packages in 338.598s

41 packages are looking for funding
  run `npm fund` for details

found 2 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

[nix-shell:~/projects/elemental-chat/tests]$ npm test

> [email protected] test /home/mhueschen/projects/elemental-chat/tests
> npm run test:setup && npm run test:standard


> [email protected] test:setup /home/mhueschen/projects/elemental-chat/tests
> CARGO_TARGET_DIR=../target cargo build --release --target wasm32-unknown-unknown && dna-util -c ../elemental-chat.dna.workdir

    Finished release [optimized] target(s) in 0.04s

> [email protected] test:standard /home/mhueschen/projects/elemental-chat/tests
> TRYORAMA_LOG_LEVEL=info RUST_LOG=holochain::core::ribosome::host_fn::debug=debug RUST_BACKTRACE=1 ts-node src/index.ts | tap-diff

        21:48:07 [tryorama] info: Using the following settings from environment variables:
        21:48:07 [tryorama] info: {
          "adminInterfaceId": "tryorama-interface-admin",
          "appInterfaceId": "tryorama-interface-app",
          "stateDumpOnError": true,
          "zomeCallTimeoutMs": 90000,
          "conductorTimeoutMs": 125000,
          "strictConductorTimeout": false,
          "chooseFreePort": false,
          "logLevel": "info",
          "portRange": [
            33000,
            34000
          ],
          "legacy": false,
          "singletonAppId": "TRYORAMA_APP",
          "holochainPath": "holochain",
          "lairPath": "lair-keystore"
        }

  chat away
        FIXME: ignoring onJoin
        21:48:07 [tryorama] info: Spawning lair for test with keystore at:  /tmp/tmp.wLsGNsL3fd/tryorama/DDeaRf/keystore
        21:48:07 [tryorama] info: Using conductor path:  holochain
        21:48:07 [tryorama] info: Holochain version:     holochain 0.0.100
        21:48:07 [tryorama] info: Conductor config path: /tmp/tmp.wLsGNsL3fd/tryorama/DDeaRf/conductor-config.yml
        21:48:07 info:
        ☉☉☉ [[[CONDUCTOR c0]]]
        ☉
        ☉ ###HOLOCHAIN_SETUP###
        ☉ ###ADMIN_PORT:33000###
        ☉ ###HOLOCHAIN_SETUP_END###
        ☉ Conductor ready.
        ☉
        21:48:07 [tryorama] info: Conductor 'c0' process spawning completed.
        21:48:08 [tryorama] error: Test error: {
          type: 'error',
          data: {
            type: 'internal_error',
            data: 'Conductor returned an error while using a ConductorApi: EntryDefStoreError(DnaError(WasmError(Compile("link error: Import not found, namespace: env, name: __debug"))))'
          }
        }
    ✖  Test threw an exception. See output for details. at <anonymous> (/home/mhueschen/projects/elemental-chat/tests/node_modules/@holochain/tryorama/src/middleware.ts:137:13)
        undefinedundefined
        21:48:08 [tryorama] info: conductor 'c0' exited with code null
        FIXME: ignoring onLeave
    ✖  test exited without ending: multi-chunk at process.<anonymous> (/home/mhueschen/projects/elemental-chat/tests/node_modules/tape/index.js:85:19)
        undefinedundefined

passed: 0  failed: 2  of 2 tests  (16.8s)

2 of 2 tests failed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:standard: `TRYORAMA_LOG_LEVEL=info RUST_LOG=holochain::core::ribosome::host_fn::debug=debug RUST_BACKTRACE=1 ts-node src/index.ts | tap-diff`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:standard script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mhueschen/.npm/_logs/2021-02-26T03_48_22_755Z-debug.log
npm ERR! Test failed.  See above for more details.
@mhuesch
Copy link
Author

mhuesch commented Feb 26, 2021

I am realizing that the revision of holonix I chose could be an issue - it is the latest on develop as of now. I was under the impression it is RSM-y...

@zippy
Copy link
Member

zippy commented Feb 26, 2021

No I you did that part right, the issue is just that the develop branch of elemental chat DNA is using an hdk version that hasn't caught up to where holochain.love is pointing to. For this to compile you actually have to check out the holochain repo and use nix-shell there instead and then check-out the same holochain rev as is being used by this branch which you can see in your output.

I'm in the middle of updating all the components to be compatible with tip of holochain develop. In this repo that's in the catchup branch, but this has dependencies on updates to holochain-conductor-api and tryorama that aren't quite done yet.

@mhuesch
Copy link
Author

mhuesch commented Apr 10, 2021

hi again, sorry for going away for so long. I switched priorities to just focus on DSL development in Rust-only (no Holochain) when I realized getting set up with RSM would take some work, and never wrote the reply I meant to write 🙇

I just tried again, following a combination of your steps and that of the repo READMEs (which might be no longer agree with the api of the hc-* commands? I see no hc-install, but running nix-shell --argstr flavor happDev provides hc & holochain which seem to be what is required).

here's a transcript of my latest run, which comes across a "bad membrane proof" error:

vayu :: ~/projects/holochain ‹develop› » pwd
/home/mhueschen/projects/holochain

[nix-shell:~/projects/holochain]$ git rev-parse HEAD
7f7c926d8eaf57f007848880eea56bf296410096

vayu :: ~/projects/holochain ‹develop› » nix-shell --argstr flavor happDev
Using /home/mhueschen/projects/holochain as target prefix...

[nix-shell:~/projects/holochain]$ cd ../elemental-chat/

[nix-shell:~/projects/elemental-chat]$ git rev-parse HEAD
a3c3be918bd2ace4f7d6d93081c7c344d3acd1f1

[nix-shell:~/projects/elemental-chat]$ CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown
    Finished release [optimized] target(s) in 0.06s

[nix-shell:~/projects/elemental-chat]$ hc dna pack . -o elemental-chat.dna
+ [[ -n /home/mhueschen/projects/holochain ]]
+ :
+ crate=hc
+ shift
+ cargo run --target-dir=/home/mhueschen/projects/holochain/target --manifest-path=/home/mhueschen/projects/holochain/crates/hc/Cargo.toml -- dna pack . -o elemental-chat.dna
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `/home/mhueschen/projects/holochain/target/debug/hc dna pack . -o elemental-chat.dna`
Wrote bundle elemental-chat.dna

[nix-shell:~/projects/elemental-chat]$ hc app pack . -o elemental-chat.happ
+ [[ -n /home/mhueschen/projects/holochain ]]
+ :
+ crate=hc
+ shift
+ cargo run --target-dir=/home/mhueschen/projects/holochain/target --manifest-path=/home/mhueschen/projects/holochain/crates/hc/Cargo.toml -- app pack . -o elemental-chat.happ
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `/home/mhueschen/projects/holochain/target/debug/hc app pack . -o elemental-chat.happ`
Wrote bundle elemental-chat.happ

[nix-shell:~/projects/elemental-chat]$ cd tests/

[nix-shell:~/projects/elemental-chat/tests]$ npm install
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

audited 204 packages in 2.111s

41 packages are looking for funding
  run `npm fund` for details

found 2 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

[nix-shell:~/projects/elemental-chat/tests]$ npm test

> [email protected] test /home/mhueschen/projects/elemental-chat/tests
> npm run test:setup && npm run test:standard


> [email protected] test:setup /home/mhueschen/projects/elemental-chat/tests
> CARGO_TARGET_DIR=../target cargo build --release --target wasm32-unknown-unknown && hc dna pack .. -o ../elemental-chat.dna && hc app pack .. -o ../elemental-chat.happ

    Finished release [optimized] target(s) in 0.06s
+ [[ -n /home/mhueschen/projects/holochain ]]
+ :
+ crate=hc
+ shift
+ cargo run --target-dir=/home/mhueschen/projects/holochain/target --manifest-path=/home/mhueschen/projects/holochain/crates/hc/Cargo.toml -- dna pack .. -o ../elemental-chat.dna
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `/home/mhueschen/projects/holochain/target/debug/hc dna pack .. -o ../elemental-chat.dna`
Wrote bundle ../elemental-chat.dna
+ [[ -n /home/mhueschen/projects/holochain ]]
+ :
+ crate=hc
+ shift
+ cargo run --target-dir=/home/mhueschen/projects/holochain/target --manifest-path=/home/mhueschen/projects/holochain/crates/hc/Cargo.toml -- app pack .. -o ../elemental-chat.happ
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `/home/mhueschen/projects/holochain/target/debug/hc app pack .. -o ../elemental-chat.happ`
Wrote bundle ../elemental-chat.happ

> [email protected] test:standard /home/mhueschen/projects/elemental-chat/tests
> TRYORAMA_LOG_LEVEL=info RUST_LOG=holochain::core::ribosome::host_fn::debug=debug RUST_BACKTRACE=1 ts-node src/index.ts | tap-diff

        14:31:58 [tryorama] info: Using the following settings from environment variables:
        14:31:58 [tryorama] info: {
          "adminInterfaceId": "tryorama-interface-admin",
          "appInterfaceId": "tryorama-interface-app",
          "stateDumpOnError": true,
          "zomeCallTimeoutMs": 90000,
          "conductorTimeoutMs": 125000,
          "strictConductorTimeout": false,
          "chooseFreePort": false,
          "logLevel": "info",
          "portRange": [
            33000,
            34000
          ],
          "legacy": false,
          "singletonAppId": "TRYORAMA_APP",
          "holochainPath": "holochain",
          "lairPath": "lair-keystore"
        }

  bad membrane proof
        FIXME: ignoring onJoin
        14:31:59 [tryorama] info: Spawning lair for test with keystore at:  /tmp/tmp.CmlkQLmPLF/tryorama/AyMPte/keystore
Error: spawn lair-keystore ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

passed: 0  failed: 0  of 0 tests  (2.1s)

All of 0 tests passed!

might this be due to a holochain revision mismatch like you warned about above?

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

2 participants