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

Issue #8 - alternate /tests/ setup for 100% maven #45

Closed
wants to merge 3 commits into from
Closed

Issue #8 - alternate /tests/ setup for 100% maven #45

wants to merge 3 commits into from

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Sep 19, 2016

  • Deploys jetty9:testing (tagged) image in /jetty9/
    module during integration-test phase
  • Adds /tests/
  • Adds /tests/webapps/
  • Adds /tests/gcloud-testing-core/ for common testing lib

+ Deploys jetty9:testing (tagged) image in /jetty9/
  module during integration-test phase
+ Adds /tests/
+ Adds /tests/webapps/
+ Adds /tests/gcloud-testing-core/ for common testing lib
@joakime
Copy link
Contributor Author

joakime commented Sep 19, 2016

This is an alternate approach for Issue #8 and should be considered a replacement for pull request #17

Copy link
Member

@meltsufin meltsufin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good. See some minor comments.

</exec>
<exec executable="gcloud">
<arg value="docker"/>
<arg value="push"/>
Copy link
Member

@meltsufin meltsufin Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this push to GCR should be moved to a different profile or deploy phase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important for the jetty9:testing tag, as used by the various docker images int he test webapps.

import java.util.Map;
import java.util.Objects;

public final class AppDeployment {
Copy link
Member

@meltsufin meltsufin Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some javadoc comments please on what this class is doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

public final class HttpURLUtil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: HttpUrlUtil

Copy link
Contributor Author

@joakime joakime Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its specifically designed for the HttpURLConnection from the JDK, so it make sense (and conforms to the Google checkstyle rules)

However, I filed it as Issue #49

<version>1.8</version>
<executions>
<execution>
<id>find-app-deploy-project</id>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool how you inject the current project into Maven properties! 👍
The whole block needs a comment though to make it clear what's going on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List<Entry> entries = new ArrayList<>();
Path logPath = MavenTestingUtils.getTargetPath("remote-module-version.log");
try (OutputStream output = Files.newOutputStream(logPath, StandardOpenOption.CREATE)) {
int retval = ProcessUtil.exec(output, "gcloud", "beta", "logging", "read", filter);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the Logging client library instead of gcloud CLI?

Copy link
Contributor Author

@joakime joakime Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as separate issue #47

</configuration>

</plugin>
<!-- This can be re-enabled when app-maven-plugin issue is fixed
Copy link
Member

@meltsufin meltsufin Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this just move into the individual test sub-modules right now? ...Oh, you already did that.

Copy link
Contributor Author

@joakime joakime Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done that already. But this is a note (like others) for future refactoring once appengine-maven-plugin features catch up.

@Test
public void testGet() throws IOException
{
HttpURLConnection http = HttpURLUtil.openTo(AppDeployment.SERVER_URI.resolve("/hello/"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to implement URL fetch with retries because sometimes it takes a few seconds for the app to really be up after it's deployed.

Copy link
Contributor Author

@joakime joakime Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened as issue #48

@@ -0,0 +1,41 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's blocking us from eliminating the run.sh altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its been removed in joakime@dd97cc8

@joakime
Copy link
Contributor Author

joakime commented Sep 28, 2016

Will create new issue-8 branch locally to this repo and issue a new pull request

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

Successfully merging this pull request may close these issues.

2 participants