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

Test for startproject command fails in OS X #1635

Closed
rmax opened this issue Dec 10, 2015 · 8 comments
Closed

Test for startproject command fails in OS X #1635

rmax opened this issue Dec 10, 2015 · 8 comments

Comments

@rmax
Copy link
Contributor

@rmax rmax commented Dec 10, 2015

Apparently, os.mknod is a privileged call in OS X:

$ python -c 'import os; os.mknod("/tmp/test")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 1] Operation not permitted

Output of the test failure:

$ nosetests tests/test_commands.py
...................E..
======================================================================
ERROR: test_startproject_template_override
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "lib/python2.7/site-packages/twisted/internet/utils.py", line 201, in runWithWarningsSuppressed
    reraise(exc_info[1], exc_info[2])
  File "python2.7/site-packages/twisted/internet/utils.py", line 197, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "scrapy/tests/test_commands.py", line 86, in test_startproject_template_override
    os.mknod(join(self.tmpl_proj, 'root_template'))
OSError: [Errno 1] Operation not permitted
@eLRuLL
Copy link
Member

@eLRuLL eLRuLL commented Dec 10, 2015

related PR: #1575

@palego
Copy link
Contributor

@palego palego commented Jan 11, 2016

Could you please check that PR #1657 solves this issue?

@rmax
Copy link
Contributor Author

@rmax rmax commented Jan 11, 2016

@palego I get this failure:

scrapy git:(pr/1657) ✗ nosetests tests/test_commands.py
...................F..
======================================================================
FAIL: test_startproject_template_override
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rolando/miniconda/envs/orchardmile-spiders/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/Users/rolando/miniconda/envs/orchardmile-spiders/lib/python2.7/site-packages/twisted/internet/utils.py", line 201, in runWithWarningsSuppressed
    reraise(exc_info[1], exc_info[2])
  File "/Users/rolando/miniconda/envs/orchardmile-spiders/lib/python2.7/site-packages/twisted/internet/utils.py", line 197, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/Users/rolando/Projects/gh/scrapy/tests/test_commands.py", line 94, in test_startproject_template_override
    (self.project_name, join(self.tmpl, 'project')), out)
  File "/Users/rolando/miniconda/envs/orchardmile-spiders/lib/python2.7/site-packages/twisted/trial/_synctest.py", line 497, in assertIn
    % (containee, container))
FailTest: "New Scrapy project 'testproject', using template directory '/var/folders/55/nbg15c6j4k3cg06tjfhqypd40000gn/T/tmpl2NVJx/templates/project', created in:" not in "New Scrapy project 'testproject' created in:\n    /private/var/folders/55/nbg15c6j4k3cg06tjfhqypd40000gn/T/tmpl2NVJx/testproject\n\nYou can start your first spider with:\n    cd testproject\n    scrapy genspider example example.com\n"

----------------------------------------------------------------------
Ran 22 tests in 28.886s

FAILED (failures=1)

@rmax
Copy link
Contributor Author

@rmax rmax commented Jan 15, 2016

The test fails because /var is a link to /private/var. So the output contains the path with the unexpected /private prefix.

This failure is unrelated to the mknod issue.

@palego
Copy link
Contributor

@palego palego commented Jan 18, 2016

I have just pushed a new commit to PR #1657 to work around the path mangling.

Additionally, the last line of your latest traceback indicates that PR #1575 is not applied:

"New Scrapy project 'testproject', using template directory..." not in
"New Scrapy project 'testproject' created in..."

The tests depend on the changes brought by #1575 and will fail in their absence.

@redapple
Copy link
Contributor

@redapple redapple commented Jan 26, 2016

@rolando , are you ok with closing the issue now that #1657 is merged?

@rmax
Copy link
Contributor Author

@rmax rmax commented Jan 26, 2016

@redapple yes! This issue is fixed.

@rmax rmax closed this Jan 26, 2016
@redapple
Copy link
Contributor

@redapple redapple commented Jan 26, 2016

Thanks for checking @rolando

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants