You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('retrieves the amount of loanToken a given user has supplied',asyncfunction(){awaitloadFixture(deployLeveros);const{ userWallet }=awaitloadFixture(setUpLeveros);constpublicClient=awaithre.viem.getPublicClient();constamountSuppliedByUser=awaitgetLoanTokenSupplied(publicClient,getMorphoMarketParam(leverosParam),userWallet.account!.addressasEOAAddress,)expect(amountSuppliedByUser).to.approximately(AMOUNT_LOAN_TOKEN_SUPPLIED,BigInt(147498892026))});
The test passes when I run it locally npx hardhat test but the same test fails consistently when running in my CI-CD pipeline on Gitlab, with an assertion error:
AssertionError: expected 10000000147498892026 to equal 10000000000000000000
the morpho function supplyAssetsUser used in that test says in its docstring says:
Returns the expected supply assets balance of user on a market after having accrued interest
Would that consistent 147498892026 discrepancy comes from that accrues interest calculation which somehow behave differently locally and in my CI-CD docker environement?
here is my .gitlab-ci.yml content
include:
- template: Security/SAST.gitlab-ci.ymldefault:
tags:
- local_runnerbefore_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-storestages:
- build_container
- lint
- install_project
- test
- securityvariables:
GIT_SUBMODULE_STRATEGY: recursiveCI_REGISTRY: registry.gitlab.comTEST_IMAGE: $CI_REGISTRY/leveros1/leveros-v1-core/node20-forge:latestETH_RPC_URL: "https://cloudflare-eth.com"sast:
before_script: []# You can override the included template(s) by including variable overrides# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings# Note that environment variables can be set in several places# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedencestage: securitybuild_and_push:
when:
manualbefore_script: []image: docker:latestservices:
- docker:dindstage: build_containerscript:
- echo "Building Docker image..."
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $TEST_IMAGE -f test/Dockerfile .
- docker push $TEST_IMAGElint-solhint:
stage: lintimage: $TEST_IMAGEscript:
- pnpm install
- pnpm run lint.install:
script:
- forge --version
- pnpm i
- rm -rf lib/*
- forge install foundry-rs/forge-std --no-commit
- forge install morpho-org/morpho-blue --no-commit
- forge install morpho-org/morpho-blue-oracles --no-commit
- forge update morpho-org/morpho-blue-oracles # no idea why it doesn't fetch that latest version. updated today by morpho, some CDN caching?# cmd 'forge install OpenZeppelin/[email protected] --no-commit' works in local but not in CI. workaround: manually checkout the version in the submodule# downgrade morpho-blue-oracles's openzeppelin to accommodate Morpho pinned to solc 0.8.19. temporary? workaround for issue: https://github.com/morpho-org/morpho-blue/issues/672#issuecomment-1978740721
- (cd lib/morpho-blue-oracles/lib/openzeppelin-contracts && git fetch --tags && git checkout v4.9.6)
- forge install OpenZeppelin/openzeppelin-contracts --no-commit
- (cd lib/openzeppelin-contracts && git fetch --tags && git checkout v4.9.6)test-forge:
stage: testimage: $TEST_IMAGEscript:
- !reference[.install, script]
- forge testtest-hardhat:
stage: testimage: $TEST_IMAGEscript:
- !reference[.install, script]
- npx hardhat test
The text was updated successfully, but these errors were encountered:
indeed @MerlinEgalite in that case no oracles involved in my deployment or setup function. I noticed that sometimes I have this few Gwei increase during local testing. That's when I run the test just after doing hardhat clean which delete the cache of EVM calls. The consequence are the chains of calls of my test take more time to execute (and interesting accruing to occur?)
I'm using hardhat to fork the mainnet and run unittest for my api calls and I got an issue when testing the function
my test as follow
The test passes when I run it locally
npx hardhat test
but the same test fails consistently when running in my CI-CD pipeline on Gitlab, with an assertion error:AssertionError: expected 10000000147498892026 to equal 10000000000000000000
the morpho function
supplyAssetsUser
used in that test says in its docstring says:Would that consistent 147498892026 discrepancy comes from that accrues interest calculation which somehow behave differently locally and in my CI-CD docker environement?
here is my
.gitlab-ci.yml
contentThe text was updated successfully, but these errors were encountered: