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 Failures on Windows #44

Open
GoogleCodeExporter opened this issue May 6, 2015 · 12 comments
Open

Test Failures on Windows #44

GoogleCodeExporter opened this issue May 6, 2015 · 12 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. run "python manage.py test" on standard app-engine-helper

What is the expected output? What do you see instead?
The expected output is all tests completing successfully.

The actual output is 7 failed tests from commands_test.py. All of them fail
with a message stating that "%1 is not a valid win32 application".

What version of the product are you using? On what operating system?
appengine_helper_for_django-r30, Windows XP, python 2.5

Please provide any additional information below.

It appears that out of the box you cannot call subprocess.Popen on a py
file directly. A simple change to add python as the executable will work on
windows:

    child = subprocess.Popen(["python", "./manage.py", command] + args,
stdin=infd,
                             stdout=fd, stderr=fd, cwd=os.getcwdu())

this of course requires that python is also in the path. If this is changed
 then there is still an error with the test "testRunserver(self)" because
os.kill is not implemented in python on Windows. 

Also, testLoadData is defined twice in that file.

Original issue reported on code.google.com by michael....@gmail.com on 13 Jun 2008 at 10:28

@GoogleCodeExporter
Copy link
Author

Okay I suck. I didn't look for issues already submitted. Though I appear to 
offer a
little more information than previous post.

Original comment by michael....@gmail.com on 13 Jun 2008 at 10:31

@GoogleCodeExporter
Copy link
Author

Also observe such errors on fresh install, but number of failed tests is 19:
See attached file..

Original comment by D.V.Selitsky@gmail.com on 27 Jun 2008 at 2:03

Attachments:

@GoogleCodeExporter
Copy link
Author

I am also getting 7 failed tests. 

Workaround mentioned didnt work for me.

Any other pointers? 

Original comment by akshar.dave on 3 Jul 2008 at 3:09

@GoogleCodeExporter
Copy link
Author

Try the following will fix the os.kill issue.
http://me.in-berlin.de/doc/python/faq/windows.html#how-do-i-emulate-os-kill-in-w
indows

Original comment by ronli...@gmail.com on 3 Aug 2008 at 3:03

@GoogleCodeExporter
Copy link
Author

should at least put a pointer to this issue in the docs ( 
http://code.google.com/appengine/articles/appengine_helper_for_django.html ) in 
the 'verifiy your environment' section. 

otherwise, everyone who tries that command on windows will run into problems...

Original comment by dennisf...@gmail.com on 21 Aug 2008 at 3:03

@GoogleCodeExporter
Copy link
Author

This is the errormessage when I run a newly created evironment with 

python manage.py test




....EEEEEEE............................................
======================================================================
ERROR: Tests the diffsettings command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
108, in testDiffSettings
    self.runCommand("diffsettings")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the dumpdata command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
112, in testDumpData
    self.runCommand("dumpdata")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the flush command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
116, in testFlush
    self.runCommand("flush")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is 
n....EEEEEEE............................................
======================================================================
ERROR: Tests the diffsettings command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
108, in testDiffSettings
    self.runCommand("diffsettings")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the dumpdata command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
112, in testDumpData
    self.runCommand("dumpdata")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the flush command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
116, in testFlush
    self.runCommand("flush")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the loaddata command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
124, in testLoadData
    self.runCommand("loaddata")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the reste command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
128, in testReset
    self.runCommand("reset", ["appengine_django"])
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the runserver command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
132, in testRunserver
    self.runCommand("runserver", int_after=2.0)
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the shell command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
136, in testShell
    self.runCommand("shell", input="exit")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

----------------------------------------------------------------------
Ran 55 tests in 0.561s

FAILED (errors=7)

C:\django_project\mysite>no

C:\django_project\mysite>ot a valid Win32 application

======================================================================
ERROR: Tests the loaddata command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
124, in testLoadData
    self.runCommand("loaddata")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the reste command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
128, in testReset
    self.runCommand("reset", ["appengine_django"])
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the runserver command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
132, in testRunserver
    self.runCommand("runserver", int_after=2.0)
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

======================================================================
ERROR: Tests the shell command.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
136, in testShell
    self.runCommand("shell", input="exit")
  File "C:\django_project\mysite\appengine_django\tests\commands_test.py", line
75, in runCommand
    stdout=fd, stderr=fd, cwd=os.getcwdu())
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

----------------------------------------------------------------------
Ran 55 tests in 0.561s

FAILED (errors=7)

C:\django_project\mysite>no

C:\django_project\mysite>

Original comment by amapl...@gmail.com on 6 Nov 2008 at 12:52

@GoogleCodeExporter
Copy link
Author

Same issue with me. Exactly 7 errors. Too bad, I already created a new issue 
for it 
withoug looking at the existing one. Sorry for that.

Original comment by Varun...@gmail.com on 26 Jan 2009 at 6:51

@GoogleCodeExporter
Copy link
Author

Issue 104 has been merged into this issue.

Original comment by mattbrow...@gmail.com on 27 Jan 2009 at 11:13

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

I am getting the same error with r86 revision

Original comment by kalyanku...@gmail.com on 29 May 2009 at 6:22

Attachments:

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

I suggest that Issue 162 be merged in; I experience both issues when I run 
python manage.py test.

I agree with dennisf: the documentation should be updated to include a warning 
about this. In addition, the instructions for packaging django should note that 
the test directory is required for running python manage.py test.

Original comment by allyourc...@gmail.com on 24 Jul 2010 at 8:36

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

No branches or pull requests

1 participant