wormhole-foundation / wormhole-scaffolding

Starter apps with Wormhole integration
Other
47 stars 30 forks source link

solana: clean up Makefile and Anchor.toml #73

Closed a5-pickle closed 1 year ago

a5-pickle commented 1 year ago
barnjamin commented 1 year ago

unit tests go fine, now getting:

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

anchor test --arch sbf
error: command failed: 'cargo': Bad CPU type in executable (os error 86)
make: *** [Makefile:30: integration-test] Error 1

from: https://solana.stackexchange.com/questions/3435/error-command-failed-cargo-bad-cpu-type-in-executable-os-error-86

softwareupdate --install-rosetta

its now building but the test script fails

Running test suite: "/Users/ben/wormhole-scaffolding/solana/Anchor.toml"

Unable to get latest blockhash. Test validator does not look started. Check .anchor/test-ledger/test-ledger-log.txt for errors. Consider increasing [test.startup_wait] in Anchor.toml.
make: *** [Makefile:30: integration-test] Error 1

This is apparently caused because of an issue with gnu-tar, using the brew installed one is the solution: https://solana.stackexchange.com/questions/4499/cant-start-solana-test-validator-on-macos-13-0-1/4761#4761

And last issue seems to be that I need to run npm install before trying make test

For all users:

For Mac users:

a5-pickle commented 1 year ago

unit tests go fine, now getting:

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

anchor test --arch sbf
error: command failed: 'cargo': Bad CPU type in executable (os error 86)
make: *** [Makefile:30: integration-test] Error 1

from: https://solana.stackexchange.com/questions/3435/error-command-failed-cargo-bad-cpu-type-in-executable-os-error-86

softwareupdate --install-rosetta

its now building but the test script fails

Running test suite: "/Users/ben/wormhole-scaffolding/solana/Anchor.toml"

Unable to get latest blockhash. Test validator does not look started. Check .anchor/test-ledger/test-ledger-log.txt for errors. Consider increasing [test.startup_wait] in Anchor.toml.
make: *** [Makefile:30: integration-test] Error 1

This is apparently caused because of an issue with gnu-tar, using the brew installed one is the solution: https://solana.stackexchange.com/questions/4499/cant-start-solana-test-validator-on-macos-13-0-1/4761#4761

And last issue seems to be that I need to run npm install before trying make test

For all users:

* run `npm install` prior to `make test`

For Mac users:

* Brew install `make` > 4.x (and ensure its being used as the default `make` command by adding it to $PATH)

* Brew install  `gnu-tar` (for solana-local-validator)

I needed to add node_modules as a dependency for the integration-test command. Will push a fix soon.