Skip to content

Commit d21731c

Browse files
committed
---
yaml --- r: 3027 b: refs/heads/logging-alpha c: 68a37bb h: refs/heads/master i: 3025: 5259587 3023: 72f99f5
1 parent 7bc9cf9 commit d21731c

822 files changed

Lines changed: 250557 additions & 37022 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ refs/heads/compute-alpha: b1274b5bdf4eea955f3588b56378a5ae4ba59cef
1414
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1515
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
1616
refs/heads/gcs-nio: b7f137d9c484e56339b3dd66a3d600251ae60f71
17-
refs/heads/logging-alpha: e32afa64efce44a03e14c27f1fc7d57de0e4c041
17+
refs/heads/logging-alpha: 68a37bb1ab8a5c2d1c48f2ccd2b0d3563b498cff

branches/logging-alpha/.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ before_install:
1010
install: mvn install -DskipTests=true -Dgpg.skip=true
1111
script:
1212
- utilities/verify.sh
13+
branches:
14+
only:
15+
- master
1316
after_success:
1417
- utilities/after_success.sh
1518
env:

branches/logging-alpha/CONTRIBUTING.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@ Using maven for build/test
1515
After you cloned the repository use Maven for building and running the tests.
1616
Maven 3.0+ is required.
1717

18-
When downloading the source, we recommend you obtain service account credentials.
19-
These credentials will allow you to run integration tests using `mvn verify` in command line.
20-
Follow step 2 of the [authentication instructions](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) to generate and use JSON service account credentials.
21-
22-
It's also important to test that changes don't break compatibility with App/Compute Engine and when running elsewhere.
23-
To run tests on different platforms, try deploying the apps available on the [gcloud-java-examples](https://github.com/GoogleCloudPlatform/gcloud-java-examples) repository.
24-
End-to-end tests should ensure that gcloud-java works when running on the
25-
26-
* App Engine production environment (see the docs for [uploading your app to production App Engine](https://cloud.google.com/appengine/docs/java/tools/maven#uploading_your_app_to_production_app_engine))
27-
* App Engine development server (see the docs for [testing your app with the development server](https://cloud.google.com/appengine/docs/java/tools/maven#testing_your_app_with_the_development_server))
28-
* Compute Engine (see the [Getting Started Guide](https://cloud.google.com/compute/docs/quickstart), and be sure to [enable the appropriate APIs](https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication#on-google-compute-engine))
29-
* Your desktop (using `mvn exec:java`, for example)
30-
31-
When changes are made to authentication and project ID-related code, authentication and project ID inference should be tested using all relevant methods detailed in the [authentication docs](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) and [project ID docs](https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id).
32-
33-
Known issue: If you have installed the Google Cloud SDK, be sure to log in (using `gcloud auth login`) before running tests. Though the Datastore tests use a local Datastore emulator that doesn't require authentication, they will not run if you have the Google Cloud SDK installed but aren't authenticated.
3418

3519
Adding Features
3620
---------------

branches/logging-alpha/README.md

Lines changed: 30 additions & 222 deletions
Large diffs are not rendered by default.

branches/logging-alpha/RELEASING.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,13 @@ This script takes an optional argument denoting the new version. By default, if
1010
2. Create a PR to update the pom.xml version.
1111
The PR should look something like [#225](https://github.com/GoogleCloudPlatform/gcloud-java/pull/225). After this PR is merged into GoogleCloudPlatform/gcloud-java, Travis CI will push a new website to GoogleCloudPlatform/gh-pages, push a new artifact to the Maven Central Repository, and update versions in the README files.
1212

13-
3. Before moving on, verify that the artifacts have successfully been pushed to the Maven Central Repository. Open Travis CI, click the ["Build History" tab](https://travis-ci.org/GoogleCloudPlatform/gcloud-java/builds), and open the second build's logs for Step 2's PR. Be sure that you are not opening the "Pull Request" build logs. When the build finishes, scroll to the end of the log and verify that the artifacts were successfully staged and deployed. You can also search for `gcloud-java` on the [Sonatype website](https://oss.sonatype.org/#nexus-search;quick~gcloud-java) and check the latest version number. If the deployment didn't succeed because of a flaky test, rerun the build.
13+
3. Create a release on Github manually.
14+
Go to the [releases page](https://github.com/GoogleCloudPlatform/gcloud-java/releases) and click "Draft a new release." Use `vX.Y.Z` as the "Tag Version" and `X.Y.Z` as the "Release Title", where `X.Y.Z` is the release version as listed in the `pom.xml` files.
1415

15-
4. Publish a release on Github manually.
16-
Go to the [releases page](https://github.com/GoogleCloudPlatform/gcloud-java/releases) and open the appropriate release draft. Make sure the "Tag Version" is `vX.Y.Z` and the "Release Title" is `X.Y.Z`, where `X.Y.Z` is the release version as listed in the `pom.xml` files. The draft should already have all changes that impact users since the previous release. To double check this, you can use the `git log` command and look through the merged master branch pull requests. Here is an example of the log command to get non-merge commits between v0.0.12 and v0.1.0:
17-
18-
```
19-
git --no-pager log v0.0.12..v0.1.0 --pretty=oneline --abbrev-commit --no-merges
20-
```
21-
22-
Ensure that the format is consistent with previous releases (for an example, see the [0.1.0 release](https://github.com/GoogleCloudPlatform/gcloud-java/releases/tag/v0.1.0)). After adding any missing updates and reformatting as necessary, publish the draft. Finally, create a new draft for the next release.
23-
24-
5. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
16+
4. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
2517
As mentioned before, there is an optional version argument. By default, the script will update the version from "X.Y.Z" to "X.Y.Z+1-SNAPSHOT". Suppose a different version is desired, for example X+1.0.0-SNAPSHOT. Then the appropriate command to run would be `utilities/update_pom_version.sh X+1.0.0-SNAPSHOT`.
2618

27-
6. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
28-
29-
7. Be sure to update App Engine documentation and [java-docs-samples](https://github.com/GoogleCloudPlatform/java-docs-samples) code as necessary. See directions [here](https://docs.google.com/a/google.com/document/d/1SS3xNn2v0qW7EadGUPBUAPIQAH5VY6WSFmT17ZjjUVE/edit?usp=sharing).
19+
5. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
3020

3121
### To push a snapshot version
3222

branches/logging-alpha/TESTING.md

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
## gcloud-java tools for testing
22

3-
This library provides tools to help write tests for code that uses the following gcloud-java services:
4-
5-
- [Datastore] (#testing-code-that-uses-datastore)
6-
- [Storage] (#testing-code-that-uses-storage)
7-
- [Resource Manager] (#testing-code-that-uses-resource-manager)
8-
- [BigQuery] (#testing-code-that-uses-bigquery)
3+
This library provides tools to help write tests for code that uses gcloud-java services.
94

105
### Testing code that uses Datastore
116

@@ -56,8 +51,7 @@ Currently, there isn't an emulator for Google Cloud Storage, so an alternative i
5651
3. Create a `RemoteGcsHelper` object using your project ID and JSON key.
5752
Here is an example that uses the `RemoteGcsHelper` to create a bucket.
5853
```java
59-
RemoteGcsHelper gcsHelper =
60-
RemoteGcsHelper.create(PROJECT_ID, new FileInputStream("/path/to/my/JSON/key.json"));
54+
RemoteGcsHelper gcsHelper = RemoteGcsHelper.create(PROJECT_ID, "/path/to/my/JSON/key.json");
6155
Storage storage = gcsHelper.options().service();
6256
String bucket = RemoteGcsHelper.generateBucketName();
6357
storage.create(BucketInfo.of(bucket));
@@ -71,67 +65,5 @@ Here is an example that clears the bucket created in Step 3 with a timeout of 5
7165
RemoteGcsHelper.forceDelete(storage, bucket, 5, TimeUnit.SECONDS);
7266
```
7367

74-
### Testing code that uses Resource Manager
75-
76-
#### On your machine
77-
78-
You can test against a temporary local Resource Manager by following these steps:
79-
80-
1. Before running your testing code, start the Resource Manager emulator `LocalResourceManagerHelper`. This can be done as follows:
81-
82-
```java
83-
import com.google.gcloud.resourcemanager.testing.LocalResourceManagerHelper;
84-
85-
LocalResourceManagerHelper helper = LocalResourceManagerHelper.create();
86-
helper.start();
87-
```
88-
89-
This will spawn a server thread that listens to `localhost` at an ephemeral port for Resource Manager requests.
90-
91-
2. In your program, create and use a Resource Manager service object whose host is set to `localhost` at the appropriate port. For example:
92-
93-
```java
94-
ResourceManager resourceManager = LocalResourceManagerHelper.options().service();
95-
```
96-
97-
3. Run your tests.
98-
99-
4. Stop the Resource Manager emulator.
100-
101-
```java
102-
helper.stop();
103-
```
104-
105-
This method will block until the server thread has been terminated.
106-
107-
### Testing code that uses BigQuery
108-
109-
Currently, there isn't an emulator for Google BigQuery, so an alternative is to create a test
110-
project. `RemoteBigQueryHelper` contains convenience methods to make setting up and cleaning up the
111-
test project easier. To use this class, follow the steps below:
112-
113-
1. Create a test Google Cloud project.
114-
115-
2. Download a [JSON service account credentials file][create-service-account] from the Google
116-
Developer's Console.
117-
118-
3. Create a `RemoteBigQueryHelper` object using your project ID and JSON key.
119-
Here is an example that uses the `RemoteBigQueryHelper` to create a dataset.
120-
```java
121-
RemoteBigQueryHelper bigqueryHelper =
122-
RemoteBigQueryHelper.create(PROJECT_ID, new FileInputStream("/path/to/my/JSON/key.json"));
123-
BigQuery bigquery = bigqueryHelper.options().service();
124-
String dataset = RemoteBigQueryHelper.generateDatasetName();
125-
bigquery.create(DatasetInfo.builder(dataset).build());
126-
```
127-
128-
4. Run your tests.
129-
130-
5. Clean up the test project by using `forceDelete` to clear any datasets used.
131-
Here is an example that clears the dataset created in Step 3.
132-
```java
133-
RemoteBigQueryHelper.forceDelete(bigquery, dataset);
134-
```
13568

13669
[cloud-platform-storage-authentication]:https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts
137-
[create-service-account]:https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount

branches/logging-alpha/codacy-conf.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)