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

fix: avoid interference from rust tests during IDL generation #3058

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The minor version will be incremented upon a breaking change and the patch versi

### Fixes

- idl: Make safety comment checks fail silently when program path env is not set ([#3045](https://github.com/coral-xyz/anchor/pull/3045])).
- idl: Make safety comment checks fail silently when program path env is not set ([#3045](https://github.com/coral-xyz/anchor/pull/3045)).
- idl: Avoid interference from rust tests during IDL generation ([#3058](https://github.com/coral-xyz/anchor/pull/3058)).

### Breaking

Expand Down
4 changes: 3 additions & 1 deletion idl/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ fn build(program_path: &Path, resolution: bool, skip_lint: bool, no_docs: bool)
"--- IDL begin errors ---" => state = State::Errors(vec![]),
"--- IDL begin program ---" => state = State::Program(vec![]),
_ => {
if line.starts_with("test result: ok") {
if line.starts_with("test result: ok")
&& !line.starts_with("test result: ok. 0 passed; 0 failed; 0")
{
if let Some(idl) = idl.as_mut() {
idl.address = mem::take(&mut address);
idl.constants = mem::take(&mut constants);
Expand Down
Loading