Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Upgrading from 2.2.0 to 2.3.0 causes "pattern did not match any files" errors #2551

Closed
myartsev opened this issue Sep 28, 2015 · 15 comments
Closed

Comments

@myartsev
Copy link

With the upgrade to 2.3.0, I am unable to run my existing test suite because of these errors:

WARNING - pattern D:\code\test\foo.e2e.spec.js did not match any files.

The pattern used to find these files is:
code/tests/**/*.e2e.spec.js

Reverting back to 2.2.0 fixes these issues.

@myartsev
Copy link
Author

It may be helpful to note that I am running protractor from Gulp using gulp-protractor

@jlin412
Copy link

jlin412 commented Sep 28, 2015

Are you using windows? There seems to be a problem with windows since
2.2.0. We were using cucumber.js framework. See if you can pass in the
normalized path instead i.e. path.normalize("path/to/some.feature");

On Mon, Sep 28, 2015 at 5:35 PM, anijap notifications@github.com wrote:

It may be helpful to note that I am running protractor from Gulp using
gulp-protractor https://github.com/mllrsohn/gulp-protractor


Reply to this email directly or view it on GitHub
#2551 (comment)
.

@rustyx
Copy link

rustyx commented Sep 29, 2015

Passing normalized string does not help. Rolling back to 2.2.0 helps.

@GustavSt
Copy link

I managed to get around it by creating my an empty stream and then pipe gulp-protractor.
var Readable = require('stream').Readable;

var protractor = require('gulp-protractor').protractor;

In the task where i ran gulp-protractor instead of providing a src i just start with an empty stream. SInce I have aldready provided the spec files in the config.
var read = new Readable();
read._read = function () {};
read.push(null);
return read.pipe(protractor({configFile: __dirname + '/protractor.conf.js'}));

@rustyx
Copy link

rustyx commented Sep 29, 2015

Of course it would be nice to be able to use the "normal" way.

But the workaround seems to work

I put the specs in protractor.conf.js:
specs: [ '**/*.e2e.spec.js' ]

Then pass an empty stream:
return gulp.src([]).pipe(protractor({configFile: 'app/tests/protractor.conf.js'}));

@GustavSt
Copy link

that's an easier way of doing a empty stream... Don't know why I never tried that..

@juliemr
Copy link
Member

juliemr commented Sep 29, 2015

Should this be moved to gulp-protractor?

@joshmgrant
Copy link

This issue also occurs with grunt tasks.

Sample output based on a grunt runner task:

Some notes: the referenced file:

  • The spec file "splat-e2e\se_specs\letters\letters_spec.js" is the correct file path to a Jasmine spec file
  • I'm using grunt v0.4.5 and grunt-cli v0.1.13
  • I'm using Windows 7
"C:\Program Files (x86)\JetBrains\WebStorm 10.0.3\bin\runnerw.exe" "C:\Program Files (x86)\nodejs\node.exe" C:\protractor_tests\node_modules\grunt-cli\bin\grunt --gruntfile C:\protractor_tests\Gruntfile.js letters
Running "protractor:letters" (protractor) task
WARNING - pattern C:\protractor_tests\splat-e2e\se_specs\letters\letters_spec.js did not match any files.
C:\protractor_tests\node_modules\protractor\node_modules\q\q.js:126
                    throw e;
                          ^
Error: Spec patterns did not match any files.
    at Runner.run (C:\protractor_tests\node_modules\protractor\lib\runner.js:249:11)
    at TaskRunner.run (C:\protractor_tests\node_modules\protractor\lib\taskRunner.js:123:19)
    at createNextTaskRunner (C:\protractor_tests\node_modules\protractor\lib\launcher.js:223:20)
    at C:\protractor_tests\node_modules\protractor\lib\launcher.js:246:7
    at _fulfilled (C:\protractor_tests\node_modules\protractor\node_modules\q\q.js:797:54)
    at self.promiseDispatch.done (C:\protractor_tests\node_modules\protractor\node_modules\q\q.js:826:30)
    at Promise.promise.promiseDispatch (C:\protractor_tests\node_modules\protractor\node_modules\q\q.js:759:13)
    at C:\protractor_tests\node_modules\protractor\node_modules\q\q.js:573:44
    at flush (C:\protractor_tests\node_modules\protractor\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:355:11)
[launcher] Process exited with error code 1

@myartsev
Copy link
Author

Julie, I would start by looking at protractor itself.
The version of gulp-protractor has stayed the same, it's only the 2.2.0 -> 2.3.0 upgrade that causes the issue to surface. Something must have changed in protractor for this to have happened.

The root issue may well be in a different library, but I don't have enough information at this point to be able to make that call.

@NickTomlin
Copy link
Contributor

So this is conjecture, but I wonder if ff88e has something to do with this.

Specifically:

var fileName = patterns[i].split(':')[0],
    lineNumber = patterns[i].split(':')[1],
    matches = glob.sync(fileName, {cwd: cwd});

Windows paths start with : e.g. C:\protractor_tests and so the fileName that is passed to glob.sync would be C. I'll try to boot up a VM and try this out after work tonight.

@jgaver
Copy link

jgaver commented Sep 30, 2015

@NickTomlin I think you are on to something.

This stopped working for me on Windows when upgrading to protractor 2.3.0. I logged fileName and lineNumber out during a test run. You can see the values below.

      var fileName = patterns[i].split(':')[0],
          lineNumber = patterns[i].split(':')[1],
          matches = glob.sync(fileName, { cwd: cwd });

      console.log('filename: ' + fileName);
      console.log('lineNumber: ' + lineNumber);
filename: m
lineNumber: \path\to\my.feature
WARNING - pattern m:\workspace\path\to\my.feature did not match any files.

As you can see, it's unable to find our feature files (used for cucumber.js).

m is the windows drive of the current working directory. (i.e. I am sitting at m:\workpace) and that is what is captured for the filename.

@juliemr
Copy link
Member

juliemr commented Sep 30, 2015

Yup, this looks like a bug. Sorry this slipped through.

@juliemr juliemr added this to the 2.5 milestone Sep 30, 2015
@jlin412
Copy link

jlin412 commented Sep 30, 2015

it will be great to fix on 2.4.0.

On Wed, Sep 30, 2015 at 6:25 PM, Julie Ralph notifications@github.com
wrote:

Yup, this looks like a bug. Sorry this slipped through.


Reply to this email directly or view it on GitHub
#2551 (comment)
.

@juliemr
Copy link
Member

juliemr commented Oct 7, 2015

This is fixed in 2.5.0, which is out now.

@juliemr juliemr closed this as completed Oct 7, 2015
@myartsev
Copy link
Author

myartsev commented Oct 7, 2015

Thanks Julie!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants