-
Notifications
You must be signed in to change notification settings - Fork 447
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
[ink_e2e]
utilize contract-build
crate
#1523
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1523 +/- ##
==========================================
+ Coverage 65.08% 71.69% +6.61%
==========================================
Files 204 204
Lines 6315 6321 +6
==========================================
+ Hits 4110 4532 +422
+ Misses 2205 1789 -416
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
contract-build
crate[ink_e2e]
utilize contract-build
crate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you had a bigger vision in mind already with use-ink/cargo-contract#787 👌
I'd approve, but I haven't been able to build this locally on my Mac or using Docker wit the latest production CI image. I keep running into the following issue
error: custom attribute panicked
--> lib.rs:57:9
|
57 | #[ink_e2e::test]
| ^^^^^^^^^^^^^^^^
|
= help: message: contract build for Cargo.toml failed: Mismatching versions of `parity-scale-codec` were found!
Please ensure that your contract and your ink! dependencies use a compatible version of this package.
error: custom attribute panicked
--> lib.rs:109:9
|
109 | #[ink_e2e::test]
| ^^^^^^^^^^^^^^^^
|
= help: message: Once instance has previously been poisoned
CI passes and local output from cargo-tree
looks okay, so not sure what's up, but worth looking into before we merge this
crates/e2e/macro/src/codegen.rs
Outdated
let manifest_path = | ||
ManifestPath::new(path_to_cargo_toml).expect("Invalid manifest path"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mention what path we tried to use
crates/e2e/macro/src/codegen.rs
Outdated
optimization_passes: Default::default(), | ||
keep_debug_symbols: false, | ||
lint: false, | ||
output_type: Default::default(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was OutputType::Json
before, I guess changing this is fine now since we don't manually need to parse the build output, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this observation I've made all options explicit instead of relying on Default::default()
which could yield some invisible breaking changes, e.g. I recently changed OptimizationPasses
to an Option
.
It's a misleading error, it is in fact because of using The difference now is that previously we invoked So the question is how to handle this. We could:
Update: I've done |
Sidenote, I remember why I was running the E2E tests with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
crates/e2e/macro/Cargo.toml
Outdated
@@ -21,10 +21,11 @@ proc-macro = true | |||
|
|||
[dependencies] | |||
ink_ir = { version = "4.0.0-beta", path = "../../ink/ir" } | |||
contract-build = "2.0.0-beta" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we can either pull in a Git dep here so that we can use +nightly
again, or wait until a new version of cargo-contract
is released. I'm okay with waiting for a new version of cargo-contract
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to the latest 2.0.0-beta.1
release which allows +nightly
. Also --features
can be passed through now anyway from the command line so you can also do cargo contract test --features e2e-tests
We should definitely pass the features through then (update see use-ink/cargo-contract#853). For me |
use-ink/cargo-contract#787 introduces the new
contract-build
library, which we can utilize here instead of depending on a user installed version ofcargo-contract
.