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

iah integration tests #37

Closed
wants to merge 14 commits into from
Closed

Conversation

Kirill-K-1
Copy link

Add basic integration tests

@Kirill-K-1 Kirill-K-1 requested a review from a team as a code owner June 22, 2023 12:06
near-units.workspace = true
tokio.workspace = true
anyhow.workspace = true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be a separate workspace crate, but instead it should be in /oracle/tests

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should. This is not unit tests, but integration tests for multiple crates inside workspace. To test multiple crates inside a workspace a recommended way is to have a tests crate in workspace instead

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of that we already have in oracle integration tests, we can use contracts/tests crate to provide common functionality to other integrtation tests (eg registry/test etc...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact tokio also have integration tests in each sub crate.

let wasm = std::fs::read(contract_path)?;
let (id, sk) = worker.dev_generate().await;

let contract = worker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just use dev_deploy here and replace the dev_generate and create_tla_and_deploy with one line. We are not using the account later in here

}

let (id, sk) = worker.dev_generate().await;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as below

&sec_key,
)?;

// TODO: add check for specific error text
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is done already

@robert-zaremba robert-zaremba changed the title Feature/integration tests with rust iah integration tests Aug 29, 2023
contracts/Cargo.toml Outdated Show resolved Hide resolved
@@ -5,7 +5,8 @@ add-deps:
rustup target add wasm32-unknown-unknown

build:
@RUSTFLAGS='-C link-arg=-s' cargo build --all --target wasm32-unknown-unknown --release
@RUSTFLAGS='-C link-arg=-s' cargo build --workspace --exclude tests --target wasm32-unknown-unknown --release
@mkdir -p res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be rollback , we have `res: entry in the Makefile

@cp ../target/wasm32-unknown-unknown/release/*.wasm ../res/


build-all:
@RUSTFLAGS='-C link-arg=-s' cargo build --all --target wasm32-unknown-unknown --release
@mkdir -p ../res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -5,7 +5,7 @@ authors = ["Robert Zaremba 'https://zaremba.ch/'"]
edition = "2021"

[lib]
crate-type = ["cdylib"]
crate-type = ["cdylib", "lib"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rlib should be used (we already have it in master for few months)

near-units.workspace = true
tokio.workspace = true
anyhow.workspace = true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of that we already have in oracle integration tests, we can use contracts/tests crate to provide common functionality to other integrtation tests (eg registry/test etc...)

@sczembor
Copy link
Contributor

The changes were merged in this PR #90. Since it was left for so long it was easier to create a new one

@sczembor sczembor closed this Sep 26, 2023
@sczembor sczembor deleted the feature/integration-tests-with-rust branch September 26, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants