Comments (9)
I think that an accurate version to test this would be with something like this:
$ clarinet test
$ echo $?
from clarinet.
Here is an example where we included clarinet check
as a step before clarinet test
and both succeeded when they shouldn't have:
https://github.com/citycoins/citycoin/runs/2786873970?check_suite_focus=true
from clarinet.
Unfortunately #34 is not fixed.
Executing following commands should results with upss
printed to the screen when we test invalid contract, yet in both cases all we see is output from clarinet.
$ clarinet check || echo 'upss'
$ clarinet test || echo 'upss'
I'm using last version available in crates.io.
[lnow@localhost citycoin]$ cargo install clarinet
Updating crates.io index
Ignored package `clarinet v0.10.0` is already installed, use --force to override
from clarinet.
Trying that locally leads to the same result, exit code is 0
.
$ clarinet check
Analysis error: use of unresolved variable 'this-will-cause-an-error'
;; CityCoins on Stacks, simulating PoX in a smart contract
this-will-cause-an-error
;; error codes
(define-constant ERR-NO-WINNER u0)
(define-constant ERR-NO-SUCH-MINER u1)
(define-constant ERR-IMMATURE-TOKEN-REWARD u2)
(define-constant ERR-UNAUTHORIZED u3)
...(output truncated)...
$ echo $?
0
The same goes for clarinet test
:
$ clarinet test
Analysis error: use of unresolved variable 'this-will-cause-an-error'
;; CityCoins on Stacks, simulating PoX in a smart contract
this-will-cause-an-error
;; error codes
(define-constant ERR-NO-WINNER u0)
(define-constant ERR-NO-SUCH-MINER u1)
(define-constant ERR-IMMATURE-TOKEN-REWARD u2)
(define-constant ERR-UNAUTHORIZED u3)
...(output truncated)...
$ echo $?
0
Now if I change the contract code so that its valid, but instead fail a test in our sequence, the exit code is updated as expected.
$ clarinet test
running 100 tests
test [CityCoin] SIP-010: transfer() succeeds with no memo supplied ... FAILED (440ms)
failures:
[CityCoin] SIP-010: transfer() succeeds with no memo supplied
Error: Expected ok, got (err u1)
at consume (https://deno.land/x/[email protected]/index.ts:366:11)
at String.expectOk (https://deno.land/x/[email protected]/index.ts:379:10)
at file:///home/whoabuddy/citycoin/tests/citycoin_test.ts:85:34
at fn (https://deno.land/x/[email protected]/test_suite.ts:457:17)
at async Object.exitSanitizer [as fn] (deno:deno_runtime-0.9.3/js/40_testing.js:101:9)
at async TestRunner.[Symbol.asyncIterator] (deno:deno_runtime-0.9.3/js/40_testing.js:275:13)
at async Object.runTests (deno:deno_runtime-0.9.3/js/40_testing.js:352:22)
at async file:///home/whoabuddy/citycoin/$deno$test.ts:3:1
failures:
[CityCoin] SIP-010: transfer() succeeds with no memo supplied
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out (440ms)
$ echo $?
1
from clarinet.
Should be addressed with latest, can you close this issue once confirmed on your end? Thanks!
from clarinet.
(will update here once the docker image has been updated)
from clarinet.
I'm still seeing this issue with version clarinet v0.10.0
, where invalid code doesn't change the exit code for clarinet check
or clarinet test
.
from clarinet.
Confirming this is working correctly in clarinet 0.13.0
, for both clarinet check
and clarinet test
- thank you!
from clarinet.
Thanks @whoabuddy!
from clarinet.
Related Issues (20)
- TypeError: Object.entries(...).toSorted is not a function when using Node.js v18.15 HOT 3
- Costs and coverage reports are blank HOT 5
- [devnet] log file is not saved for stacks-devnet-js
- Use new deployment plan customisation logic for devnet and clarinet console
- `clarinet devnet start` out of clarinet context
- Aloow to deploy contracts from a custom index HOT 3
- String-ascii clarinet bug HOT 2
- Update stacks-node and add stacks-signer HOT 1
- Add nakamoto boot contracts to the simnet
- LSP error with certain tuple HOT 9
- Clarinet Devnet Fails to produce Stacks blocks after Bitcoin RPC call HOT 5
- Sending SIGINT/SIGTERM to the process started by clarinet dev start doesn't trigger a graceful shutdown
- Epoch 3.0 handling in Devnet
- 2.5 readiness - Run Nakamoto by default
- Unable to use the 'replace-at?' function in contract HOT 2
- Add support to retrieve the observable events from the contracts in a given Clarinet project HOT 9
- Generate a `.gitattributes` file when creating a new project
- Publish a clarinet-sdk package for the browser
- Handle contract deletion in simnet deployment plan
- Have a way to fork mainnet HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clarinet.