Skip to content

Commit

Permalink
Fix mapping + events tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Jan 8, 2025
1 parent e918997 commit 8692832
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,33 @@ jobs:
with:
# run all tests with --all-features, which will run the e2e-tests feature if present
args:
/bin/bash -c "scripts/for_all_contracts_exec.sh --path integration-tests --ignore public/static-buffer --partition ${{ matrix.partition }}/6 -- \
/bin/bash -c "scripts/for_all_contracts_exec.sh --path integration-tests --ignore public/static-buffer --ignore public/mapping --partition ${{ matrix.partition }}/6 -- \
cargo +nightly test --all-features --all --manifest-path {}"

examples-test-mapping:
runs-on: ubuntu-latest
needs: [clippy]
strategy:
matrix:
partition: [1, 2, 3, 4, 5, 6]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Cache
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
cache-directories: ${{ env.CARGO_TARGET_DIR }}

- name: Test Examples
env:
# needed for `mapping::e2e_tests::fallible_storage_methods_work`
INK_STATIC_BUFFER_SIZE: 256
run:
cargo +nightly test --all-features --all --manifest-path integration-tests/public/mapping/Cargo.toml

examples-custom-test:
# todo
if: false
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/public/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std = [
ink-as-dependency = []
e2e-tests = []

[profile.test]
#[profile.test]
# Need this for linkme crate to work for the event metadata unit test.
# See https://github.com/dtolnay/linkme/issues/61#issuecomment-1503653702
lto = "thin"
#lto = "thin"
5 changes: 4 additions & 1 deletion integration-tests/public/mapping/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ mod mapping {
mut client: Client,
) -> E2EResult<()> {
// Makes testing the fallible storage methods more efficient
std::env::set_var("INK_STATIC_BUFFER_SIZE", "256");
const ERR: &str = "For this test the env variable `INK_STATIC_BUFFER_SIZE` needs to be set to `256`";
let buffer_size = std::env::var("INK_STATIC_BUFFER_SIZE")
.unwrap_or_else(|err| panic!("{} {}", ERR, err));
assert_eq!(buffer_size, "256", "{}", ERR);

// given
eprintln!("----1");
Expand Down

0 comments on commit 8692832

Please sign in to comment.