Skip to content
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

676 libms commander error on windows #888

Merged

Conversation

nichlaes
Copy link
Collaborator

No description provided.

@nichlaes nichlaes linked an issue Aug 23, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (eaa22d5) to head (d359c6d).
Report is 25 commits behind head on feature/distributed-demo.

Current head d359c6d differs from pull request most recent head 05d0f01

Please upload reports for the commit 05d0f01 to get more accurate results.

Files with missing lines Patch % Lines
servers/lib/src/cloudcmd/cloudcmd.ts 0.00% 6 Missing and 1 partial ⚠️
...vers/lib/src/files/services/local-files.service.ts 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (eaa22d5) and HEAD (d359c6d). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (eaa22d5) HEAD (d359c6d)
client-unit-integration-tests 1 0
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/distributed-demo    #888       +/-   ##
============================================================
- Coverage                     66.49%   0.00%   -66.50%     
============================================================
  Files                            31       6       -25     
  Lines                           394     107      -287     
  Branches                         26       3       -23     
============================================================
- Hits                            262       0      -262     
+ Misses                          117     104       -13     
+ Partials                         15       3       -12     
Files with missing lines Coverage Δ
...vers/lib/src/files/services/local-files.service.ts 0.00% <0.00%> (ø)
servers/lib/src/cloudcmd/cloudcmd.ts 0.00% <0.00%> (ø)

... and 34 files with indirect coverage changes

Components Coverage Δ
Website ∅ <ø> (∅)
Lib Microservice 0.00% <ø> (∅)

@prasadtalasila
Copy link
Contributor

@nichlaes Please consider the following suggestions:

  1. Bump up the version code at patch-level (new version is 0.4.6)
  2. Check the functioning of pm2-specific yarn commands both on Windows and Linux
  3. Update the documentation in admin/servers/lib.
  4. There is a docker compose for libms but the matching documentation is missing in README.md and DEVELOPER.md. Please see in client for an example.
  5. Check the functioning of docker compose on Windows and Linux OS platforms

servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
servers/lib/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nichlaes
Please change CloudCMD word to CloudCMD (an npm package dependency)

@prasadtalasila
Copy link
Contributor

@nichlaes
It might be possible to consider the path given, host operating system and then convert the path to relative one on Windows.
This formatting would fix the error on Windows.
Please let me know if this is the right way to proceed.

@prasadtalasila
Copy link
Contributor

@nichlaes I get the following error.

$yarn build
yarn run v1.22.19
$ npx tsc
                                                                               
                This is not the tsc command you are looking for                
                                                                               

To get access to the TypeScript compiler, tsc, from the command line either:

- Use npm install typescript to first add TypeScript to your project before using npx
- Use yarn to avoid accidentally running code from un-installed packages
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

$yarn add typescript

$ yarn build
yarn run v1.22.19
$ npx tsc
Done in 3.65s.

This did not happen before. Do you know why?

servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
@prasadtalasila
Copy link
Contributor

@nichlaes are you also addressing issue #482 here?

Copy link
Contributor

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nichlaes please see the comments. Thanks.

"clean": "npx rimraf build node_modules coverage dist src.svg test.svg",
"format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\"",
"graph": "npx madge --image src.svg src && npx madge --image test.svg test",
"start": "node dist/src/main.js",
"start:pm2": "pm2 start pm2.config.js",
"stop:pm2": "pm2 delete libms",
"syntax": "npx eslint . --fix",
"syntax": "eslint . --fix",
"pretest": "npx shx cp test/data/user2/tools/README.md ../../files/user2/tools/README.md",
"posttest": "npx rimraf ../../files/user2/tools/README.md",
"test:all": "npx cross-env LOCAL_PATH=test/data jest --testPathIgnorePatterns=cloudcmd --coverage",
"test:e2e": "npx cross-env LOCAL_PATH=test/data jest --config ./test/jest-e2e.json --coverage",
"test:http": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms-test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command, when executed on git-bash of Windows 11, is giving the following error.

$ yarn test:http
yarn run v1.22.19
$ yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage --coverageThreshold="{}" && pm2 delete libms-test
$ tsc
[PM2] Starting C:\Users\au598657\git\DTaaS\servers\lib\dist\src\main.js in fork_mode (1 instance)
[PM2] Done.
┌────┬───────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name          │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼───────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ libms-test    │ default     │ 0.4.6   │ fork    │ 28440    │ 0s     │ 0    │ online    │ 9.3%     │ 54.8mb   │ au598657 │ disabled │
└────┴───────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
  console.log
    {
      path: '/',
      files: [
        {
          name: 'common',
          size: '0b',
          date: '08.04.2024',
          owner: 0,
          mode: 'rw- rw- rw-',
          type: 'directory'
        },
        {
          name: 'template',
          size: '0b',
          date: '18.06.2024',
          owner: 0,
          mode: 'rw- rw- rw-',
          type: 'directory'
        },
        {
          name: 'user1',
          size: '0b',
          date: '11.12.2023',
          owner: 0,
          mode: 'rw- rw- rw-',
          type: 'directory'
        },
        {
          name: 'user2',
          size: '0b',
          date: '11.12.2023',
          owner: 0,
          mode: 'rw- rw- rw-',
          type: 'directory'
        },
        {
          name: 'README.md',
          size: '180b',
          date: '11.12.2023',
          owner: 0,
          mode: 'rw- rw- rw-',
          type: 'file'
        },
        {
          name: 'test.txt',
          size: '12b',
          date: '11.09.2024',
          owner: 0,
          mode: 'rw- rw- rw-',
          type: 'file'
        }
      ]
    }

      at Object.<anonymous> (test/cloudcmd/cloudcmd.spec.ts:27:13)

 PASS  test/cloudcmd/cloudcmd.spec.ts (10.616 s)
  cloudcmd test for the application
    √ should return the correct directory that is set as root (103 ms)
    √ should return the content of a file that is uplaoded to cloudcmd  (5 ms)
    √ should upload a file to cloudcmd (30 ms)

---------------------------|---------|----------|---------|---------|-------------------
File                       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------------------|---------|----------|---------|---------|-------------------
All files                  |       0 |        0 |       0 |       0 |
 src                       |       0 |        0 |       0 |       0 |
  bootstrap.ts             |       0 |        0 |       0 |       0 | 1-36
  types.ts                 |       0 |      100 |       0 |       0 | 1-91
 src/cloudcmd              |       0 |        0 |       0 |       0 |
  cloudcmd.ts              |       0 |        0 |       0 |       0 | 2-40
 src/files                 |       0 |      100 |     100 |       0 |
  files.module.ts          |       0 |      100 |     100 |       0 | 1-9
 src/files/resolvers       |       0 |      100 |       0 |       0 |
  files.resolver.ts        |       0 |      100 |       0 |       0 | 1-21
 src/files/services        |       0 |        0 |       0 |       0 |
  files-service.factory.ts |       0 |        0 |       0 |       0 | 1-20
  local-files.service.ts   |       0 |        0 |       0 |       0 | 1-62
---------------------------|---------|----------|---------|---------|-------------------
Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        17.925 s
Ran all test suites matching /test\\cloudcmd/i.
[PM2] Applying action deleteProcessId on app [libms-test](ids: [ 0 ])
[PM2] [libms-test](0) ✓
┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Done in 22.34s.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nichlaes has problem been resolved?

Copy link
Collaborator Author

@nichlaes nichlaes Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prasadtalasila Is that an error? Is it not just the console.log?

servers/lib/package.json Outdated Show resolved Hide resolved
servers/lib/README.md Show resolved Hide resolved
@prasadtalasila
Copy link
Contributor

@nichlaes is this PR complete?

Copy link
Contributor

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nichlaes thanks for the updates. Please see the comments.

.github/workflows/lib-ms.yml Show resolved Hide resolved
.github/workflows/lib-ms.yml Show resolved Hide resolved
servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
servers/lib/README.md Show resolved Hide resolved
servers/lib/compose.lib.dev.yml Show resolved Hide resolved
servers/lib/compose.lib.dev.yml Outdated Show resolved Hide resolved
"clean": "npx rimraf build node_modules coverage dist src.svg test.svg",
"format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\"",
"graph": "npx madge --image src.svg src && npx madge --image test.svg test",
"start": "node dist/src/main.js",
"start:pm2": "pm2 start pm2.config.js",
"stop:pm2": "pm2 delete libms",
"syntax": "npx eslint . --fix",
"syntax": "eslint . --fix",
"pretest": "npx shx cp test/data/user2/tools/README.md ../../files/user2/tools/README.md",
"posttest": "npx rimraf ../../files/user2/tools/README.md",
"test:all": "npx cross-env LOCAL_PATH=test/data jest --testPathIgnorePatterns=cloudcmd --coverage",
"test:e2e": "npx cross-env LOCAL_PATH=test/data jest --config ./test/jest-e2e.json --coverage",
"test:http": "yarn build && pm2 start -f --name libms-test dist/src/main.js -- -c .env -H ./config/http.json && jest test/cloudcmd --coverage --coverageThreshold=\"{}\" && pm2 delete libms-test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nichlaes has problem been resolved?

servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
servers/lib/DEVELOPER.md Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Sep 16, 2024

Code Climate has analyzed commit 05d0f01 and detected 0 issues on this pull request.

View more on Code Climate.

@prasadtalasila prasadtalasila merged commit 5be6bb2 into feature/distributed-demo Sep 16, 2024
12 checks passed
@prasadtalasila prasadtalasila deleted the 676-libms-commander-error-on-windows branch September 23, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libms: commander error on Windows
3 participants