Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 11 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,21 @@
<module>google-cloud-monitoring</module>
<module>google-cloud-pubsub</module>
<module>google-cloud-resourcemanager</module>
<module>google-cloud-spanner</module>
<!--<module>google-cloud-spanner</module>-->

This comment was marked as spam.

<module>google-cloud-speech</module>
<module>google-cloud-storage</module>
<module>google-cloud-trace</module>
<module>google-cloud-translate</module>
<module>google-cloud-vision</module>
<module>testing/google-cloud-managed-test</module>
<module>testing/google-cloud-appengine-flex-java</module>
<module>testing/google-cloud-appengine-flex-custom</module>
<module>testing/google-cloud-appengine-java8</module>
<module>testing/google-cloud-appengine-flex-compat</module>
<!--
Uncomment the following lines to include google app engine (GAE) testing apps in the build.
Each GAE app packages all its dependencies in a fat war (>20MB each).
-->
<!--<module>testing/google-cloud-managed-test</module>-->
<!--<module>testing/google-cloud-appengine-flex-java</module>-->
<!--<module>testing/google-cloud-appengine-flex-custom</module>-->
<!--<module>testing/google-cloud-appengine-java8</module>-->
<!--<module>testing/google-cloud-appengine-flex-compat</module>-->
</modules>
<pluginRepositories>
<pluginRepository>
Expand Down Expand Up @@ -214,7 +218,7 @@
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<!--<goal>integration-test</goal>-->

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

<goal>verify</goal>
</goals>
</execution>
Expand Down
8 changes: 6 additions & 2 deletions testing/google-cloud-appengine-flex-compat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<properties>
<appengine.sdk.version>1.9.51</appengine.sdk.version>
<appengine.maven.plugin>1.2.1</appengine.maven.plugin>
<jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
<java.source.version>1.7</java.source.version>
</properties>
Expand Down Expand Up @@ -54,9 +55,12 @@
</configuration>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.sdk.version}</version>
<version>${appengine.maven.plugin}</version>
<configuration>
<deploy.version>1</deploy.version>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>vam-veneer</application>
<application>GCLOUD_PROJECT_ID_HERE</application>

This comment was marked as spam.

<service>flex-compat</service>
<version>1</version>
<threadsafe>true</threadsafe>
<!--<instance-class>B8</instance-class>-->
<env>flex</env>
<beta-settings>
<setting name="enable_app_engine_apis" value="true"/>
</beta-settings>
<manual-scaling>
<instances>1</instances>
</manual-scaling>
<resources>
<cpu>1</cpu>
<memory-gb>4</memory-gb>
</resources>
</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
runtime: java
env: flex

runtime_config: # Optional
jdk: openjdk8
server: jetty9

handlers:
- url: /.*
script: this field is required, but ignored
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>vam-veneer</application>
<application>GCLOUD_PROJECT_ID_HERE</application>
<service>std-java8</service>
<version>1</version>
<runtime>java8</runtime>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,33 @@ public class GcjFlexTestServlet extends HttpServlet {

private static final long serialVersionUID = 523885428311420041L;

private final ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L,
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
private volatile GcjTestRunner testRunner = null;
private final ThreadPoolExecutor executor =
new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
private volatile GcjTestRunner testRunner;

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
try {
String classNames = req.getParameter("classes");
PrintWriter out = resp.getWriter();
out.append(startTest(loadClasses(classNames.split("[\\r\\n]+")), req, resp));
List<Class<?>> testClasses = loadClasses(classNames.split("[\\r\\n]+"));
String output = runTests(testClasses, req, resp);
out.append(output);
out.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
}

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
PrintWriter out = resp.getWriter();
out.append(getTestOutput(req, resp));
out.close();
}

private List<Class<?>> loadClasses(String[] classNames) throws ClassNotFoundException {
private List<Class<?>> loadClasses(String... classNames) throws ClassNotFoundException {
List<Class<?>> classes = new ArrayList<>();
for (String className : classNames) {
String cn = className.trim();
Expand All @@ -69,34 +70,44 @@ private List<Class<?>> loadClasses(String[] classNames) throws ClassNotFoundExce
return classes;
}

private String startTest(List<Class<?>> classes, HttpServletRequest req,
HttpServletResponse resp) {
private String runTests(
List<Class<?>> classes, HttpServletRequest req, HttpServletResponse resp) {
synchronized (executor) {
resp.setContentType("text/html");
if (executor.getActiveCount() > 0) {
return "Cannot start new test: the previous test hasn't completed yet.<p/>"
+ "The active test progress is at <a href='" + req.getRequestURL()
+ "'>" + req.getRequestURL() + "</a>.";
+ "The active test progress is at <a href='"
+ req.getRequestURL()
+ "'>"
+ req.getRequestURL()
+ "</a>.";
}

testRunner = new GcjTestRunner(classes);
executor.execute(testRunner);
return "Test started. Check progress at <a href='"
+ req.getRequestURL() + "'>" + req.getRequestURL() + "</a>";
+ req.getRequestURL()
+ "'>"
+ req.getRequestURL()
+ "</a>";
}
}

private String getTestOutput(HttpServletRequest req, HttpServletResponse resp) {
synchronized (executor) {
if (testRunner == null) {
resp.setContentType("text/html");
String link = req.getRequestURL()
.substring(0, req.getRequestURL().length() - req.getRequestURI().length());
return "Test hasn't been started yet. Go to <a href='" + link + "'>" + link
+ "</a> to start a new test";
if (testRunner != null) {
resp.setContentType("text");
return testRunner.getOutput();
}
resp.setContentType("text");
return testRunner.getOutput();
resp.setContentType("text/html");
int urlUriLenDiff = req.getRequestURL().length() - req.getRequestURI().length();
String link = req.getRequestURL().substring(0, urlUriLenDiff);
return "Test hasn't been started yet. Go to <a href='"
+ link
+ "'>"
+ link
+ "</a> to start a new test";

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
*/
package com.google.cloud.managed.test;

import com.google.cloud.storage.BlobIdTest;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.internal.TextListener;
import org.junit.runner.JUnitCore;
Expand All @@ -44,7 +42,7 @@ public void run() {
synchronized (resultStream) {
resultBytes.reset();
}
for(Class<?> clazz : classes) {
for (Class<?> clazz : classes) {
resultStream.append("\n").append("Running ").append(clazz.getName()).append("\n\n");
unit.run(clazz);
}
Expand Down
2 changes: 1 addition & 1 deletion utilities/update_pom_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate
CURRENT_VERSION_BASE=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')

# Get list of directories for which pom.xml must be updated
module_folders=($(find . -maxdepth 2 -type d | sed -E -n "/^\.\/(google-cloud-contrib\/)?google-cloud(-[a-z]+)+$/p") . ./google-cloud)
module_folders=($(find . -maxdepth 2 -type d | sed -E -n "/^\.\/(google-cloud-contrib\/|testing\/)?google-cloud(-[a-z0-9]+)+$/p") . ./google-cloud)

CURRENT_SNAPSHOT=""
if [ "${CURRENT_VERSION##*-}" == "SNAPSHOT" ]; then
Expand Down