LimeChain / matchstick

🔥 Unit testing framework for Subgraph development on The Graph protocol. ⚙️
MIT License
207 stars 17 forks source link

New subgraph via cli, yarn test tries to download 0.6.0/binary-linux-20 (not existing) instead of 0.6.0/binary-linux-22 #427

Open firepol opened 3 months ago

firepol commented 3 months ago

Summary

Result: on Linux yarn test tries to download (inexisting, 404 error) https://github.com/LimeChain/matchstick/releases/download/0.6.0/binary-linux-20

Expected result: yarn test should download https://github.com/LimeChain/matchstick/releases/download/0.6.0/binary-linux-22

Details

Hi,

My OS: Fedora Liunux 39 Node version: v18.x LTS, tried also v20.x LTS

I'm creating a subgraph using the cli, see https://thegraph.com/docs/en/developing/creating-a-subgraph/#from-an-existing-contract

This creates a package.json as follows:

{
  "name": "my-test",
  "scripts": {
    "codegen": "graph codegen",
    "build": "graph build",
    "test": "graph test"
  },
  "dependencies": {
    "@graphprotocol/graph-cli": "0.51.0",
    "@graphprotocol/graph-ts": "0.30.0"
  },
  "devDependencies": { "matchstick-as": "0.5.0" }

When I run yarn test I get this error:

yarn test
yarn run v1.22.21
$ graph test
Fetching latest version tag...
Downloading release from https://github.com/LimeChain/matchstick/releases/download/0.6.0/binary-linux-20
Error fetching release: Request failed with status code 404
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I did yarn upgrade matchstick-as, which downloaded 0.6.0. When I run yarn test I get the exact same error. Seems both 0.5 and 0.6 try to download the file 0.6.0/binary-linux-20.

But the correct file is 0.6.0/binary-linux-22

Full URL: https://github.com/LimeChain/matchstick/releases/download/0.6.0/binary-linux-22

You can double check at https://github.com/LimeChain/matchstick/releases/tag/0.6.0

Can you fix this please? So that all subgraph users on Linux can use matchstick for testing without hassle*?

*"Hassle": I guess (hope) there is a workaround like manually downloading binary-linux22 and placing it somewhere? Can you tell me how/where until this is fixed? Thank you

dimitrovmaksim commented 3 months ago

Hi, the version which will be downloaded depends on the graph-cli and is defined by this function https://github.com/graphprotocol/graph-tooling/blob/main/packages/cli/src/commands/test.ts#L175-L231

There's a workaround for unsupported platforms, you can use docker to run the test by passing -d flag to the test command https://thegraph.com/docs/en/developing/unit-testing-framework/#docker

Further development of matchstick (for the time being) will be handled by TheGraph in the tooling repo https://github.com/graphprotocol/graph-tooling/pull/1549