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

[git][Windows] Repository locator test failure on Windows #933

Closed
kittaakos opened this issue Dec 4, 2017 · 6 comments
Closed

[git][Windows] Repository locator test failure on Windows #933

kittaakos opened this issue Dec 4, 2017 · 6 comments
Labels
git issues related to git OS/Windows issues related to the Windows OS

Comments

@kittaakos
Copy link
Contributor

The test does not fail on Appveyor but on the local Windows image:

@theia/git:   git
@theia/git:     repositories
@theia/git:       √ should discover only first repository (3219ms)
@theia/git:       √ should discover all nested repositories (375ms)
@theia/git:       1) should discover all nested repositories and the root repository which is at the workspace root
@theia/git:       √ should discover all nested repositories and the container repository (375ms)
@theia/git:     status
@theia/git: Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114-8300-1
1qld28.ucnm
@theia/git: Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114-8300-1
1qld28.ucnm
@theia/git:       √ modifying a staged file should result in two changes (328ms)
@theia/git:     WorkingDirectoryStatus#equals
@theia/git:       √ staged change should matter
@theia/git:     show
@theia/git:       √ modified in working directory
@theia/git:       √ modified in working directory (nested)
@theia/git: Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114-8300-y
12dri.d4qsm
@theia/git: Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114-8300-y
12dri.d4qsm
@theia/git:       √ modified in index (78ms)
@theia/git: Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114-8300-1
q537mv.d1km
@theia/git: Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114-8300-1
q537mv.d1km
@theia/git:       √ modified in index and in working directory (218ms)
@theia/git:     remote
@theia/git:       √ remotes are not set by default (141ms)
@theia/git:       √ origin is the default after a fresh clone (1500ms)
@theia/git:       √ remotes can be added and queried (219ms)
@theia/git:   12 passing (8s)
@theia/git:   1 failing
@theia/git:   1) git repositories should discover all nested repositories and the root repository which is at the worksp
ace root:
@theia/git:       AssertionError: expected [ 'A', 'B', 'BASE', 'BASE', 'C' ] to deeply equal [ 'A', 'B', 'BASE', 'C' ]
@theia/git:       + expected - actual
@theia/git:        [
@theia/git:          "A"
@theia/git:          "B"
@theia/git:          "BASE"
@theia/git:       -  "BASE"
@theia/git:          "C"
@theia/git:        ]
@theia/git:
@theia/git:       at Proxy.assertEqual (C:\Users\kittaakos\dev\theia\node_modules\chai\lib\chai\core\assertions.js:1020:
19)
@theia/git:       at Proxy.methodWrapper (C:\Users\kittaakos\dev\theia\node_modules\chai\lib\chai\utils\addMethod.js:57:
25)
@theia/git:       at Suite.<anonymous> (src\node\dugite-git.spec.ts:87:101)
@theia/git:       at step (src\node\dugite-git.spec.ts:38:23)
@theia/git:       at Object.next (src\node\dugite-git.spec.ts:19:53)
@theia/git:       at fulfilled (src\node\dugite-git.spec.ts:10:58)
@theia/git:       at <anonymous>
@theia/git: npm ERR! code ELIFECYCLE
@theia/git: npm ERR! errno 1
@theia/git: npm ERR! @theia/git@0.2.3 test: `theiaext test`
@theia/git: npm ERR! Exit status 1
@theia/git: npm ERR!
@theia/git: npm ERR! Failed at the @theia/git@0.2.3 test script.
@theia/git: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@theia/git: npm ERR! A complete log of this run can be found in:
@theia/git: npm ERR!     C:\Users\kittaakos\AppData\Roaming\npm-cache\_logs\2017-12-04T09_52_24_494Z-debug.log
lerna ERR! execute Error: Command failed: npm run test
lerna ERR! execute
lerna ERR! execute ┌────────────────────────────────────────────────────────────────┐
lerna ERR! execute │                    npm update check failed                     │
lerna ERR! execute │              Try running with sudo or get access               │
lerna ERR! execute │              to the local update config store via              │
lerna ERR! execute │ sudo chown -R $USER:$(id -gn $USER) C:\Users\kittaakos\.config │
lerna ERR! execute └────────────────────────────────────────────────────────────────┘
lerna ERR! execute npm ERR! code ELIFECYCLE
lerna ERR! execute npm ERR! errno 1
lerna ERR! execute npm ERR! @theia/git@0.2.3 test: `theiaext test`
lerna ERR! execute npm ERR! Exit status 1
lerna ERR! execute npm ERR!
lerna ERR! execute npm ERR! Failed at the @theia/git@0.2.3 test script.
lerna ERR! execute npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lerna ERR! execute
lerna ERR! execute npm ERR! A complete log of this run can be found in:
lerna ERR! execute npm ERR!     C:\Users\kittaakos\AppData\Roaming\npm-cache\_logs\2017-12-04T09_52_24_494Z-debug.log
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute > @theia/git@0.2.3 test C:\Users\kittaakos\dev\theia\packages\git
lerna ERR! execute > theiaext test
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute   git
lerna ERR! execute     repositories
lerna ERR! execute       √ should discover only first repository (3219ms)
lerna ERR! execute       √ should discover all nested repositories (375ms)
lerna ERR! execute       1) should discover all nested repositories and the root repository which is at the workspace ro
ot
lerna ERR! execute       √ should discover all nested repositories and the container repository (375ms)
lerna ERR! execute     status
lerna ERR! execute Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-11qld28.ucnm
lerna ERR! execute Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-11qld28.ucnm
lerna ERR! execute       √ modifying a staged file should result in two changes (328ms)
lerna ERR! execute     WorkingDirectoryStatus#equals
lerna ERR! execute       √ staged change should matter
lerna ERR! execute     show
lerna ERR! execute       √ modified in working directory
lerna ERR! execute       √ modified in working directory (nested)
lerna ERR! execute Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-y12dri.d4qsm
lerna ERR! execute Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-y12dri.d4qsm
lerna ERR! execute       √ modified in index (78ms)
lerna ERR! execute Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-1q537mv.d1km
lerna ERR! execute Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-1q537mv.d1km
lerna ERR! execute       √ modified in index and in working directory (218ms)
lerna ERR! execute     remote
lerna ERR! execute       √ remotes are not set by default (141ms)
lerna ERR! execute       √ origin is the default after a fresh clone (1500ms)
lerna ERR! execute       √ remotes can be added and queried (219ms)
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute   12 passing (8s)
lerna ERR! execute   1 failing
lerna ERR! execute
lerna ERR! execute   1) git repositories should discover all nested repositories and the root repository which is at the
 workspace root:
lerna ERR! execute
lerna ERR! execute       AssertionError: expected [ 'A', 'B', 'BASE', 'BASE', 'C' ] to deeply equal [ 'A', 'B', 'BASE',
'C' ]
lerna ERR! execute       + expected - actual
lerna ERR! execute
lerna ERR! execute        [
lerna ERR! execute          "A"
lerna ERR! execute          "B"
lerna ERR! execute          "BASE"
lerna ERR! execute       -  "BASE"
lerna ERR! execute          "C"
lerna ERR! execute        ]
lerna ERR! execute
lerna ERR! execute       at Proxy.assertEqual (C:\Users\kittaakos\dev\theia\node_modules\chai\lib\chai\core\assertions.j
s:1020:19)
lerna ERR! execute       at Proxy.methodWrapper (C:\Users\kittaakos\dev\theia\node_modules\chai\lib\chai\utils\addMethod
.js:57:25)
lerna ERR! execute       at Suite.<anonymous> (src\node\dugite-git.spec.ts:87:101)
lerna ERR! execute       at step (src\node\dugite-git.spec.ts:38:23)
lerna ERR! execute       at Object.next (src\node\dugite-git.spec.ts:19:53)
lerna ERR! execute       at fulfilled (src\node\dugite-git.spec.ts:10:58)
lerna ERR! execute       at <anonymous>
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute     at Promise.all.then.arr (C:\Users\kittaakos\dev\theia\node_modules\execa\index.js:236:11)
lerna ERR! execute     at <anonymous>
lerna ERR! execute     at process._tickCallback (internal/process/next_tick.js:188:7)
lerna ERR! execute  callback with error
lerna ERR! execute  { Error: Command failed: npm run test
lerna ERR! execute
lerna ERR! execute ┌────────────────────────────────────────────────────────────────┐
lerna ERR! execute │                    npm update check failed                     │
lerna ERR! execute │              Try running with sudo or get access               │
lerna ERR! execute │              to the local update config store via              │
lerna ERR! execute │ sudo chown -R $USER:$(id -gn $USER) C:\Users\kittaakos\.config │
lerna ERR! execute └────────────────────────────────────────────────────────────────┘
lerna ERR! execute npm ERR! code ELIFECYCLE
lerna ERR! execute npm ERR! errno 1
lerna ERR! execute npm ERR! @theia/git@0.2.3 test: `theiaext test`
lerna ERR! execute npm ERR! Exit status 1
lerna ERR! execute npm ERR!
lerna ERR! execute npm ERR! Failed at the @theia/git@0.2.3 test script.
lerna ERR! execute npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lerna ERR! execute
lerna ERR! execute npm ERR! A complete log of this run can be found in:
lerna ERR! execute npm ERR!     C:\Users\kittaakos\AppData\Roaming\npm-cache\_logs\2017-12-04T09_52_24_494Z-debug.log
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute > @theia/git@0.2.3 test C:\Users\kittaakos\dev\theia\packages\git
lerna ERR! execute > theiaext test
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute   git
lerna ERR! execute     repositories
lerna ERR! execute       √ should discover only first repository (3219ms)
lerna ERR! execute       √ should discover all nested repositories (375ms)
lerna ERR! execute       1) should discover all nested repositories and the root repository which is at the workspace ro
ot
lerna ERR! execute       √ should discover all nested repositories and the container repository (375ms)
lerna ERR! execute     status
lerna ERR! execute Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-11qld28.ucnm
lerna ERR! execute Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-11qld28.ucnm
lerna ERR! execute       √ modifying a staged file should result in two changes (328ms)
lerna ERR! execute     WorkingDirectoryStatus#equals
lerna ERR! execute       √ staged change should matter
lerna ERR! execute     show
lerna ERR! execute       √ modified in working directory
lerna ERR! execute       √ modified in working directory (nested)
lerna ERR! execute Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-y12dri.d4qsm
lerna ERR! execute Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-y12dri.d4qsm
lerna ERR! execute       √ modified in index (78ms)
lerna ERR! execute Started watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-1q537mv.d1km
lerna ERR! execute Stopped watching the git repository: file:///c%3A/Users/KITTAA~1/AppData/Local/Temp/status-test117114
-8300-1q537mv.d1km
lerna ERR! execute       √ modified in index and in working directory (218ms)
lerna ERR! execute     remote
lerna ERR! execute       √ remotes are not set by default (141ms)
lerna ERR! execute       √ origin is the default after a fresh clone (1500ms)
lerna ERR! execute       √ remotes can be added and queried (219ms)
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute   12 passing (8s)
lerna ERR! execute   1 failing
lerna ERR! execute
lerna ERR! execute   1) git repositories should discover all nested repositories and the root repository which is at the
 workspace root:
lerna ERR! execute
lerna ERR! execute       AssertionError: expected [ 'A', 'B', 'BASE', 'BASE', 'C' ] to deeply equal [ 'A', 'B', 'BASE',
'C' ]
lerna ERR! execute       + expected - actual
lerna ERR! execute
lerna ERR! execute        [
lerna ERR! execute          "A"
lerna ERR! execute          "B"
lerna ERR! execute          "BASE"
lerna ERR! execute       -  "BASE"
lerna ERR! execute          "C"
lerna ERR! execute        ]
lerna ERR! execute
lerna ERR! execute       at Proxy.assertEqual (C:\Users\kittaakos\dev\theia\node_modules\chai\lib\chai\core\assertions.j
s:1020:19)
lerna ERR! execute       at Proxy.methodWrapper (C:\Users\kittaakos\dev\theia\node_modules\chai\lib\chai\utils\addMethod
.js:57:25)
lerna ERR! execute       at Suite.<anonymous> (src\node\dugite-git.spec.ts:87:101)
lerna ERR! execute       at step (src\node\dugite-git.spec.ts:38:23)
lerna ERR! execute       at Object.next (src\node\dugite-git.spec.ts:19:53)
lerna ERR! execute       at fulfilled (src\node\dugite-git.spec.ts:10:58)
lerna ERR! execute       at <anonymous>
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute
lerna ERR! execute     at Promise.all.then.arr (C:\Users\kittaakos\dev\theia\node_modules\execa\index.js:236:11)
lerna ERR! execute     at <anonymous>
lerna ERR! execute     at process._tickCallback (internal/process/next_tick.js:188:7)
@kittaakos kittaakos added git issues related to git OS/Windows issues related to the Windows OS labels Dec 4, 2017
@kittaakos
Copy link
Contributor Author

Moved from #936:

@kittaakos wrote:
So this was ignored and removed here.

My test fails currently, and I have the following path:

  • CONTAINING PATH c:\Users\kittaakos\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE
  • CONTAINING PATH c:\Users\kittaakos\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE
  • REPOSITORY PATH c:\Users\KITTAA~1\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE
  • CONTAINING PATH c:\Users\kittaakos\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE
  • REPOSITORY PATH c:\Users\KITTAA~1\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE\A
  • CONTAINING PATH c:\Users\kittaakos\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE
  • REPOSITORY PATH c:\Users\KITTAA~1\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE\B
  • CONTAINING PATH c:\Users\kittaakos\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE
  • REPOSITORY PATH c:\Users\KITTAA~1\AppData\Local\Temp\discovery-test-2117115-8020-as07s0.0uipf\BASE\C

The marked lines are pointing to the same location but the FS path (strings) are different.

  • I've replaced it with fs.realpath which should return a canonical name, i.e. resolve symlinks and normalize paths. It could be that it has bugs on Windows or I missed some places.

  • Ohh, I wanted to post this to [git][Windows] Repository locator test failure on Windows #933. I move everything there. Sorry. And thanks for the hint. I try fs-extra#realpath outside from Theia.

@kittaakos
Copy link
Contributor Author

fs.realpath does not normalize the FAT 8.3 file names:

const temp = require('temp');
const fs = require('fs-extra');

const track = temp.track();
const path = track.mkdirSync('foo');

console.log(path); // C:\Users\KITTAA~1\AppData\Local\Temp\foo117115-2972-11j4sb5.bro
console.log(fs.realpathSync(path)); // C:\Users\KITTAA~1\AppData\Local\Temp\foo117115-2972-11j4sb5.bro

@akosyakov
Copy link
Member

and another way around? What does it do with C:\Users\kittaakos\AppData\Local\Temp\foo117115-2972-11j4sb5.bro?

@kittaakos
Copy link
Contributor Author

Does nothing:

const temp = require('temp');
const fs = require('fs-extra');

const track = temp.track();
const path = track.mkdirSync('foo');

console.log(path); // C:\Users\KITTAA~1\AppData\Local\Temp\foo117115-2972-11j4sb5.bro
console.log(fs.realpathSync(path)); // C:\Users\KITTAA~1\AppData\Local\Temp\foo117115-2972-11j4sb5.bro

const replaced = path.replace('KITTAA~1', 'kittaakos');
console.log(replaced, fs.existsSync(replaced)); // C:\Users\kittaakos\AppData\Local\Temp\foo117115-2972-11j4sb5.bro true
console.log(fs.realpathSync(replaced)); // C:\Users\kittaakos\AppData\Local\Temp\foo117115-2972-11j4sb5.bro

@kittaakos
Copy link
Contributor Author

This problem is deeper than I have initially expected:

  • First off, one can workaround this issue with temp by passing in the AffixOptions. This did not work for me. It turned out the problem was somewhere else.
  • Simply calling require('os').tmpdir() returns with the 8.3 filename format instead of the long one.
  • I started to investigate the environment variables:
    • @ECHO %TEMP% prints the 8.3 format although that looks good in the UI:
    • Then, I have checked @ECHO %USERPROFILE%, which is correct and prints the long name. Also seems to be fine in the UI.

screen shot 2017-12-05 at 16 53 34

screen shot 2017-12-05 at 16 53 49

I will also try to modify the NtfsDisable8dot3NameCreation variable...

vince-fugnitto added a commit that referenced this issue Feb 4, 2020
Fixes #7064

Fixes the failing `git` unit test by making it more robust to
problems caused as described in #933.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Feb 5, 2020
Fixes #7064

Skips the failing `@theia/git` unit test on Windows (#933).

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Feb 5, 2020
Fixes #7064

Skips the failing `@theia/git` unit test on Windows (#933).

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Feb 5, 2020
Fixes #7064

Skips the failing `@theia/git` unit test on Windows (#933).

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Feb 5, 2020
Fixes #7064

Skips the failing `@theia/git` unit test on Windows (#933).

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
akosyakov pushed a commit to akosyakov/theia that referenced this issue Feb 24, 2020
Fixes eclipse-theia#7064

Skips the failing `@theia/git` unit test on Windows (eclipse-theia#933).

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
JesterOrNot pushed a commit to JesterOrNot/theia that referenced this issue Mar 12, 2020
Fixes eclipse-theia#7064

Skips the failing `@theia/git` unit test on Windows (eclipse-theia#933).

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
@JonasHelming
Copy link
Contributor

@kittaakos Is this still relevant? Please close if not...

@kittaakos kittaakos closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git issues related to git OS/Windows issues related to the Windows OS
Projects
None yet
Development

No branches or pull requests

3 participants