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

[#2123]Cannot run program "python": CreateProcess error=2 #1148

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ sudo: required
dist: trusty
language: java
jdk:
- oraclejdk8
#before_install:
# - cat /etc/hosts # optionally check the content *before*
# - sudo hostname "$(hostname | cut -c1-63)"
# - sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts
# - sudo mv /tmp/hosts /etc/hosts
# - cat /etc/hosts # optionally check the content *after*
- oraclejdk8
install:
- sudo apt-get install ant-optional
addons:
hosts:
- myshorthost
hostname: myshorthost

script: ant -buildfile ./framework/build.xml test
script:
- ant -buildfile ./framework/build.xml test

after_failure:
find samples-and-tests -name '*.failed.html' -exec echo {} \; -exec cat {} \;
Expand Down
10 changes: 8 additions & 2 deletions framework/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,24 @@
<condition property="playExtension" value="">
<and><os family="unix"/></and>
</condition>
<condition property="pythonExecutable" value="${basedir}/../python/python.exe">
<and><os family="windows"/></and>
</condition>
<condition property="pythonExecutable" value="python">
<and><os family="unix"/></and>
</condition>

<echo message="Testing unittests" />

<antcall target="unittest" />

<echo message="Testing development lifecycle (wait ...)" />

<exec executable="python" failonerror="true">
<exec executable="${pythonExecutable}" failonerror="true">
<arg value="${basedir}/../samples-and-tests/i-am-a-developer/tests.py" />
</exec>

<exec executable="python" failonerror="true">
<exec executable="${pythonExecutable}" failonerror="true">
<arg value="${basedir}/../samples-and-tests/i-am-a-developer/test_jvm_version_flag.py" />
</exec>

Expand Down
8 changes: 5 additions & 3 deletions framework/pym/play/commands/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ def autotest(app, args):
if app.readConf('headlessBrowser'):
headless_browser = app.readConf('headlessBrowser')

fpcp = [os.path.join(app.play_env["basedir"], 'modules/testrunner/lib/play-testrunner.jar')]
fpcp = []
fpcp.append(os.path.normpath(os.path.join(app.play_env["basedir"], 'modules/testrunner/conf')))
fpcp.append(os.path.join(app.play_env["basedir"], 'modules/testrunner/lib/play-testrunner.jar'))
fpcp_libs = os.path.join(app.play_env["basedir"], 'modules/testrunner/firephoque')
for jar in os.listdir(fpcp_libs):
if jar.endswith('.jar'):
fpcp.append(os.path.normpath(os.path.join(fpcp_libs, jar)))
cp_args = ':'.join(fpcp)
if os.name == 'nt':
cp_args = ';'.join(fpcp)
java_cmd = [java_path()] + add_options + ['-classpath', cp_args, '-Dapplication.url=%s://localhost:%s' % (protocol, http_port), '-DheadlessBrowser=%s' % (headless_browser), 'play.modules.testrunner.FirePhoque']
cp_args = ';'.join(fpcp)
java_cmd = [java_path()] + add_options + ['-Djava.util.logging.config.file=logging.properties', '-classpath', cp_args, '-Dapplication.url=%s://localhost:%s' % (protocol, http_port), '-DheadlessBrowser=%s' % (headless_browser), 'play.modules.testrunner.FirePhoque']
if protocol == 'https':
java_cmd.insert(-1, '-Djavax.net.ssl.trustStore=' + app.readConf('keystore.file'))
try:
Expand Down
13 changes: 13 additions & 0 deletions framework/test-src/play/templates/FastTagsTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package play.templates;

import groovy.lang.Closure;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import play.mvc.Http;
Expand All @@ -18,15 +19,27 @@
public class FastTagsTest {

private StringWriter out = new StringWriter();
final String backupSystemLineBreak = System.getProperty("line.separator");

@Before
public void setUp() throws Exception {
//if you render html into out
// and expect results with line breaks
// take into account that your tests will fail on other platforms
// force line.separator be the same on any platform
// or use String.format in expected code with the placeholder '%n' for any expected line separation.
System.setProperty("line.separator","\n");
Http.Response.current.set(new Http.Response());
Http.Response.current().encoding = "UTF-8";

Scope.Session.current.set(new Scope.Session());
Scope.Session.current().put("___AT", "1234");
}
@After
public void tearDown() throws Exception {
// restore line.separator
System.setProperty("line.separator", backupSystemLineBreak);
}

@Test
public void _form_simple() throws Exception {
Expand Down
61 changes: 61 additions & 0 deletions modules/testrunner/conf/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
############################################################
# Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################

############################################################
# Global properties
############################################################

# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers= java.util.logging.ConsoleHandler

# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level= INFO

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

# Example to customize the SimpleFormatter output format
# to print one-line log message like this:
# <level>: <log message> [<date/time>]
#
# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n

############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
com.gargoylesoftware.htmlunit.DefaultCssErrorHandler = OFF
com.gargoylesoftware.htmlunit = OFF
org.apache.http.impl.execchain.RetryExec = OFF
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public class FirePhoque {

public static void main(String[] args) throws Exception {

Logger.getLogger(DefaultCssErrorHandler.class.getName()).setLevel(Level.OFF);
Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);

String app = System.getProperty("application.url", "http://localhost:9000");

// Tests description
Expand Down