-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat(test): adding JS tests to the CI #284
Conversation
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.
small review :)
path: cairo/target | ||
key: ${{ runner.os }}-cairo-${{ github.sha }} | ||
fail-on-cache-miss: true | ||
- name: Setup and run dev chain |
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.
- name: Setup and run dev chain | |
- name: Setup dev chain and run tests |
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.
resolved
js_tests/basic.test.ts
Outdated
await provider.waitForTransaction(declareResponse.transaction_hash); | ||
|
||
// Add assertion to check if the class hash is valid | ||
expect(declareResponse.class_hash).toBeTruthy(); |
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 get class hash and see if it's on chain
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.
resolved
js_tests/basic.test.ts
Outdated
); | ||
|
||
// Add assertion to check if the contract address is valid | ||
expect(deployResult.contract_address[0]).toBeTruthy(); |
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 can maybe call get class hast at and check if it's registered on chain
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.
resolved
js_tests/basic.test.ts
Outdated
); | ||
|
||
// Add assertion to check if the account address is valid | ||
expect(deployResult.contract_address[0]).toBeTruthy(); |
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.
same as above
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.
resolved
sudo apt-get update | ||
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler | ||
- uses: rui314/setup-mold@v1 | ||
- uses: software-mansion/setup-scarb@v1 |
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.
Any reason why you are calling 2 times software-mansion/setup-scarb@v1 for version 2.8.2?
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.
my bad, removed
.github/workflows/build.yml
Outdated
- uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- uses: software-mansion/setup-scarb@v1 |
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.
also here
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.
resolved
.github/workflows/build.yml
Outdated
uses: actions/cache@v3 | ||
with: | ||
path: target/release/madara | ||
key: ${{ runner.os }}-madara-${{ github.sha }} |
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.
Here it appears that you are generating you key over the commit hash this doesnt invalidate the cache on each commit?
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 have checked maybe you can use:
key: ${{ runner.os }}-madara-${{ hashFiles('Cargo.lock') }}
to generate a key based on the lock changes or take in account even more files
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.
resolved
js_test: | ||
name: Run JS Tests | ||
uses: ./.github/workflows/starknet-js-test.yml | ||
needs: build |
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.
why does js_test depends on build? could we parallelize that?
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 need a build of madara to have it's instance running before running tests on it
so the flow is that we run madara and we run tests on it, so for that we need the latest build
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.
okk nice
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.
could we move the js_tests unde tests/js_tests?
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.
you mean inside the crates?
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.
no in the root folder directly, so we can add more tests in the futur
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.
resolved
…ly and testing something with coverage as well
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.
lgtm
Adding starknet js tests
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
What is the current behavior?
Resolves: #NA
What is the new behavior?
Does this introduce a breaking change?
No