Unverified Commit c2e43fc6 authored by Michael Müller's avatar Michael Müller Committed by GitHub
Browse files

Fix `Greeter` and run documentation tests in CI (#773)

* Run documentation tests in CI

* Use `format` from `prelude`

The contract build will fail otherwise due to
the usage of `std::string::String` because of
`std::format`.

* Remove superfluous mutable

* Reduce amount of fuzz runs

The CI run already takes quite long and I don't think
it makes that much difference if we reduce the amount
of runs. The bugs we catched so far were always catched
with way less runs than even this new number.

* Run documentation tests as part of `test` stage
parent c0d9b789
Pipeline #135333 passed with stages
in 29 minutes and 1 second
......@@ -122,6 +122,7 @@ test:
QUICKCHECK_TESTS: 0
script:
- cargo test --verbose --all-features --no-fail-fast --workspace
- cargo test --verbose --all-features --no-fail-fast --workspace --doc
docs:
stage: workspace
......@@ -375,7 +376,7 @@ fuzz-tests:
<<: *docker-env
variables:
# The QUICKCHECK_TESTS default is 100
QUICKCHECK_TESTS: 40000
QUICKCHECK_TESTS: 20000
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
......
......@@ -28,6 +28,7 @@ ink_metadata = { version = "3.0.0-rc3", path = "../../metadata/" }
ink_env = { version = "3.0.0-rc3", path = "../../env/" }
ink_storage = { version = "3.0.0-rc3", path = "../../storage/" }
ink_lang = { version = "3.0.0-rc3", path = ".." }
ink_prelude = { version = "3.0.0-rc3", path = "../../prelude/" }
trybuild = "1.0.24"
scale-info = { version = "0.6", default-features = false, features = ["derive"] }
......
......@@ -397,6 +397,8 @@ use proc_macro::TokenStream;
/// #
/// #[ink::contract]
/// mod greeter {
/// use ink_prelude::format;
///
/// #[ink(storage)]
/// pub struct Greeter;
///
......@@ -410,7 +412,7 @@ use proc_macro::TokenStream;
/// }
///
/// #[ink(message, payable)]
/// pub fn fund(&mut self) {
/// pub fn fund(&self) {
/// let caller = self.env().caller();
/// let value = self.env().transferred_balance();
/// let message = format!("thanks for the funding of {:?} from {:?}", value, caller);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment