Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 479688

Summary: Unit tests fail under nodegit 0.5.0
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: NodeAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 10.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 474353    

Description Mark Macdonald CLA 2015-10-13 15:55:28 EDT
The nodegit unit tests pass under nodegit 0.4.0, but fail under nodegit 0.5.0.

1) Run these commands one time to fetch the required dependencies:
 $ cd modules/orionode
 $ npm install 
 $ npm install nodegit@0.5.0

2) Then to run the tests:
 $ mocha --grep git

The output that comes back shows 8 test failures:

>   29 passing (22s)
>   8 failing
> 
>   1) git Use case 1 Creating and adding a new file GET status (check status for git repo):
>      Uncaught Error: expected 200 "OK", got 403 "Forbidden"
>       at net.js:1409:10
> 
>   2) git Use case 1 Committing an added file POST commit (committing all files in the index):
>      Uncaught Error: expected 200 "OK", got 403 "Forbidden"
>       at net.js:1409:10
> 
>   3) git Use case 1 Fetching a remote POST remote (fetching changes from a remote):
>      Uncaught Error: expected 201 "Created", got 403 "Forbidden"
>       at net.js:1409:10
> 
>   4) git Use case 1 Add a new remote and push to it POST remote (pushing to a new remote):
>      Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.
> 
> 
>   5) git Use case 3 Adding a branch POST branch (creating a branch):
>      Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
> 
> 
>   6) git Use case 3 Adding a branch Check nodegit that branch exists:
>      Uncaught Error: Reference 'refs/remotes/test-branch/HEAD' not found
>       at Error (native)
> 
>   7) git Use case 3 Getting list of branches GET branch (listing branches):
>      Uncaught TypeError: Cannot read property 'FullName' of undefined
>       at Test.<anonymous> (test/test-git-api.js:565:39)
>       at net.js:1409:10
> 
>   8) git Use case 3 Deleting a branch DELETE branch (removing a branch):
>      Error: expected 200 "OK", got 403 "Forbidden"
>       at net.js:1409:10
Comment 1 Mark Macdonald CLA 2015-10-13 18:00:34 EDT
(In reply to Mark Macdonald from comment #0)
> 2) Then to run the tests:
>  $ mocha --grep git

Correction: this command should be 

  $ node_modules/.bin/mocha --grep git

or simply 

 $ npm test

(Although npm test is slower, since it runs all the tests)
Comment 2 Silenio Quarti CLA 2016-04-15 10:50:25 EDT
This has been fixed

silenios-mbp:orionode silenio$ mocha --grep git


  git
    Use case 1
      Creates a new directory and init repository
        ✓ GET clone (initializes a git repo) (64ms)
        ✓ Check the directory was made
        ✓ Check nodegit that the repo was initialized
      Creating and adding a new file
        ✓ PUT index (staging a file)
        ✓ GET status (check status for git repo)
      Committing an added file
        ✓ POST commit (committing all files in the index)
        ✓ GET commit (listing commits revision)
        ✓ Check nodegit for commits
      Adding a remote
        ✓ POST remote (adding a new remote)
      Get list of remotes
        ✓ GET remote (getting the list of remotes)
        ✓ Check nodegit for list of remotes
      Fetching a remote
        ✓ POST remote (fetching changes from a remote) (2103ms)
      Deleting a remote
        ✓ DELETE remote (removing a remote)
        ✓ Check nodegit for deleted remote
      Add a new remote and push to it
        ✓ POST remote (adding a new remote)
        ✓ POST remote (pushing to a new remote) (1672ms)
      Removing a repository
        ✓ DELETE clone (delete a repository)
        ✓ Check nodegit for deleted repo
    Use case 2
      Cloning a new repository
        ✓ POST clone (creating a respository clone) (1794ms)
        ✓ Check the directory was made
      Listing tags
        ✓ GET tag (listing tags)
      Removing a repository
        ✓ DELETE clone (delete a repository)
        ✓ Check nodegit for deleted repo
    Use case 3
      Creates a new directory and init repository
        ✓ GET clone (initializes a git repo)
        ✓ Check the directory was made
        ✓ Check nodegit that the repo was initialized
      Adding a remote
        ✓ POST remote (adding a new remote)
      Adding a branch
        ✓ POST branch (creating a branch)
        ✓ Check nodegit that branch exists
      Getting list of branches
        ✓ GET branch (listing branches)
      Deleting a branch
        ✓ DELETE branch (removing a branch)
        ✓ Check nodegit that branch exists
      Removing a repository
        ✓ DELETE clone (delete a repository)
        ✓ Check nodegit for deleted repo
    config
      ✓ gets repo config
      ✓ gets key
      ✓ updates key


  37 passing (8s)