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

Updates file unit tests to be Windows compatible #24281

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

tylersmalley
Copy link
Contributor

Summary

Replaces #23674
Related to #21315

Resolves the following mocha test failing on Windows:

Failures:

  1. dev/File #getRelativePath() returns the path relative to the repo root:
      Error: expected 'src\\dev\\__tests__\\file.js' to sort of equal 'src/dev/__tests__/file.js'
      + expected - actual

      -src\dev\__tests__\file.js
      +src/dev/__tests__/file.js
      
      at Assertion.assert (node_modules\expect.js\index.js:96:13)
      at Assertion.eql (node_modules\expect.js\index.js:230:10)
      at Context.it (C:/Users/vagrant/kibana/src/dev/__tests__/file.js:41:41)
  1. dev/File #getRelativeParentDirs() returns the parents of a file, stopping at the repo root, in descending order:
      Error: expected [ 'src\\dev\\__tests__', 'src\\dev', 'src' ] to sort of equal [ 'src/dev/__tests__', 'src/dev', 'src' ]
      + expected - actual

       [
      -  "src\\dev\\__tests__"
      -  "src\\dev"
      +  "src/dev/__tests__"
      +  "src/dev"
         "src"
       ]
      
      at Assertion.assert (node_modules\expect.js\index.js:96:13)
      at Assertion.eql (node_modules\expect.js\index.js:230:10)
      at Context.it (C:/Users/vagrant/kibana/src/dev/__tests__/file.js:71:47)
  1. src/dev/npm/installed_packages getInstalledPackages() reads all installed packages of a module:
 Error: expected [ { name: 'dep1',
    version: '0.0.2',
    repository: 'https://github.com/mycorp/dep1',
    licenses: [ 'Apache-2.0' ],
    directory: 'C:\\Users\\vagrant\\kibana\\src\\dev\\npm\\__tests__\\fixtures\\fixture1\\node_modules\\dep1',
    relative: 'node_modules\\dep1' },
  { name: 'privatedep',
    version: '0.0.2',
    repository: 'https://github.com/mycorp/privatedep',
    licenses: [ 'Apache-2.0' ],
    directory: 'C:\\Users\\vagrant\\kibana\\src\\dev\\npm\\__tests__\\fixtures\\fixture1\\node_modules\\privatedep',
    relative: 'node_modules\\privatedep' } ] to sort of equal [ { name: 'dep1',
    version: '0.0.2',
    licenses: [ 'Apache-2.0' ],
    repository: 'https://github.com/mycorp/dep1',
    directory: 'C:\\Users\\vagrant\\kibana\\src\\dev\\npm\\__tests__\\fixtures\\fixture1\\node_modules\\dep1',
    relative: 'node_modules/dep1' },
  { name: 'privatedep',
    version: '0.0.2',
    repository: 'https://github.com/mycorp/privatedep',
    licenses: [ 'Apache-2.0' ],
    directory: 'C:\\Users\\vagrant\\kibana\\src\\dev\\npm\\__tests__\\fixtures\\fixture1\\node_modules\\privatedep',
    relative: 'node_modules/privatedep' } ]
      + expected - actual

           "licenses": [
             "Apache-2.0"
           ]
           "name": "dep1"
      -    "relative": "node_modules\\dep1"
      +    "relative": "node_modules/dep1"
           "repository": "https://github.com/mycorp/dep1"
           "version": "0.0.2"
         }
         {
           "licenses": [
             "Apache-2.0"
           ]
           "name": "privatedep"
      -    "relative": "node_modules\\privatedep"
      +    "relative": "node_modules/privatedep"
           "repository": "https://github.com/mycorp/privatedep"
           "version": "0.0.2"
         }
       ]
      
      at Assertion.assert (node_modules\expect.js\index.js:96:13)
      at Assertion.eql (node_modules\expect.js\index.js:230:10)
      at Context.it (C:/Users/vagrant/kibana/src/dev/npm/__tests__/installed_packages.js:57:35)

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@tylersmalley tylersmalley added Team:Operations Team label for Operations Team v7.0.0 v6.5.0 labels Oct 19, 2018
Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💔 Build Failed

@tylersmalley
Copy link
Contributor Author

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@tylersmalley tylersmalley merged commit 938d130 into elastic:master Oct 19, 2018
tylersmalley added a commit to tylersmalley/kibana that referenced this pull request Oct 19, 2018
tylersmalley added a commit that referenced this pull request Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Operations Team label for Operations Team v6.5.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants