vechain / vechain-sdk-js

The official JavaScript SDK for VeChain.
24 stars 9 forks source link

Run a quick test of the RC on a Windows machine #1406

Open victhorbi opened 1 month ago

leszek-vechain commented 1 week ago

Description

I was able to get my hands on windows laptop (8GB RAM) with following configuration:

Steps

  1. clone repo - no issues
  2. installed yarn - no issues
  3. yarn install - no issues
  4. yarn build - a few problems arrived
  5. yarn test - another bunch of problems

Problems - yarn build

Rm -rf usage It seems we use a lot of rm -rf commands to remove certain ./dist folders, but Windows does not have any equivalent for that.

Solution Install rimraf package via yarn and update the package.json files with "rimraf ./dist" instead of "rm -rf dist"

Error: Delete 'cr' prettier/prettier This one was connected to sdk-nextjs-integration app, it seems that on windows files in that folder have end line characters added, and eslint does not like it.

Solution Set endOfLine to auto in .eslintrc.json in app folder:

{
    'prettier/prettier': [
        "error", {
            "endOfLine": "auto"
        }
    ]
}

it skips the check - not ideal but it works.

Docs not building Docs are using find command to filter and delete files during build, but windows does not have any equivalent for it.

Solution None, just skipped build for docs.

**Problems - yarn test:solo"

Docker To run this we need docker for windows. Installed version 4.34.3, but it did not want to start at all. Long story short, there is an ongoing issue with WSL (Windows Subsystem for Linux).

Solution I did update to version 2.3.24.0, but this solution not always works for everyone.

Docker compose -f For some reason docker did not like -f param in sdk-aws-kms-adapter start thor solo command. It did throw this error:

sdk-aws-kms-adapter:test: unknown shorthand flag: 'f' in -f
sdk-aws-kms-adapter:test: See 'docker --help'

Solution None for now

Test passed

The reason why they fail is too low specced laptop as docker + windows eats tons of RAM. Most failures were connected to timeouts and some docker issues.

victhorbi commented 1 week ago

Testing will continue on a hosted machine: https://vechain.atlassian.net/wiki/spaces/~7120202ab7770ebfe743cdb496f230ebfd9779/pages/920485889/SDK+AWS+Windows+EC2+Instance