Skip to content

Commit e245942

Browse files
danielduhhBenWhiteheadtritone
authored
feat: configure initial sp version (#883)
* feat: configure initial sp version * fix(test): update blob paths used in storage.it.ITStorageTest#testDownloadPublicBlobWithoutAuthentication (#759) Port of googleapis/google-cloud-go#3806 Fixes #755 * test: remove error string matching (#861) It looks like the text for this error on the backend has changed (sometimes) from "Precondition Failed" to "At least one of the pre-conditions you specified did not hold". I don't think it's really necessary to check the exact message in any case given that we do check for a code of 412, which implies a precondition failure. I added a check of the error Reason instead, which is more standardized. Fixes #853 Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com> Co-authored-by: Chris Cotter <cjcotter@google.com>
1 parent 12bd62c commit e245942

2 files changed

Lines changed: 66 additions & 58 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 61 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,87 @@
1-
on:
1+
'on':
22
push:
33
branches:
4-
- master
5-
pull_request:
4+
- 1.111.3-patch
5+
pull_request: null
66
name: ci
77
jobs:
88
units:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
java: [7, 8, 11]
12+
java:
13+
- 7
14+
- 8
15+
- 11
1316
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-java@v1
16-
with:
17-
java-version: ${{matrix.java}}
18-
- run: java -version
19-
- run: .kokoro/build.sh
20-
env:
21-
JOB_TYPE: test
22-
- name: coverage
23-
uses: codecov/codecov-action@v1
24-
with:
25-
name: actions ${{matrix.java}}
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-java@v1
19+
with:
20+
java-version: ${{matrix.java}}
21+
- run: java -version
22+
- run: .kokoro/build.sh
23+
env:
24+
JOB_TYPE: test
2625
windows:
2726
runs-on: windows-latest
2827
steps:
29-
- uses: actions/checkout@v2
30-
- uses: actions/setup-java@v1
31-
with:
32-
java-version: 8
33-
- run: java -version
34-
- run: .kokoro/build.bat
35-
env:
36-
JOB_TYPE: test
28+
- uses: actions/checkout@v2
29+
- uses: actions/setup-java@v1
30+
with:
31+
java-version: 8
32+
- run: java -version
33+
- run: .kokoro/build.bat
34+
env:
35+
JOB_TYPE: test
3736
dependencies:
3837
runs-on: ubuntu-latest
3938
strategy:
4039
matrix:
41-
java: [8, 11]
40+
java:
41+
- 8
42+
- 11
4243
steps:
43-
- uses: actions/checkout@v2
44-
- uses: actions/setup-java@v1
45-
with:
46-
java-version: ${{matrix.java}}
47-
- run: java -version
48-
- run: .kokoro/dependencies.sh
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-java@v1
46+
with:
47+
java-version: ${{matrix.java}}
48+
- run: java -version
49+
- run: .kokoro/dependencies.sh
4950
linkage-monitor:
5051
runs-on: ubuntu-latest
5152
steps:
52-
- uses: actions/checkout@v2
53-
- uses: actions/setup-java@v1
54-
with:
55-
java-version: 8
56-
- run: java -version
57-
- run: .kokoro/linkage-monitor.sh
53+
- uses: actions/checkout@v2
54+
- uses: actions/setup-java@v1
55+
with:
56+
java-version: 8
57+
- run: java -version
58+
- name: Install artifacts to local Maven repository
59+
run: .kokoro/build.sh
60+
shell: bash
61+
- name: >-
62+
Validate any conflicts with regard to com.google.cloud:libraries-bom
63+
(latest release)
64+
uses: >-
65+
GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor
5866
lint:
5967
runs-on: ubuntu-latest
6068
steps:
61-
- uses: actions/checkout@v2
62-
- uses: actions/setup-java@v1
63-
with:
64-
java-version: 8
65-
- run: java -version
66-
- run: .kokoro/build.sh
67-
env:
68-
JOB_TYPE: lint
69+
- uses: actions/checkout@v2
70+
- uses: actions/setup-java@v1
71+
with:
72+
java-version: 8
73+
- run: java -version
74+
- run: .kokoro/build.sh
75+
env:
76+
JOB_TYPE: lint
6977
clirr:
7078
runs-on: ubuntu-latest
7179
steps:
72-
- uses: actions/checkout@v2
73-
- uses: actions/setup-java@v1
74-
with:
75-
java-version: 8
76-
- run: java -version
77-
- run: .kokoro/build.sh
78-
env:
79-
JOB_TYPE: clirr
80+
- uses: actions/checkout@v2
81+
- uses: actions/setup-java@v1
82+
with:
83+
java-version: 8
84+
- run: java -version
85+
- run: .kokoro/build.sh
86+
env:
87+
JOB_TYPE: clirr

google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,11 +2053,11 @@ public void testDownloadPublicBlobWithoutAuthentication() {
20532053

20542054
// try to download blobs from a public bucket
20552055
String landsatBucket = "gcp-public-data-landsat";
2056-
String landsatPrefix = "LC08/PRE/044/034/LC80440342016259LGN00/";
2057-
String landsatBlob = landsatPrefix + "LC80440342016259LGN00_MTL.txt";
2056+
String landsatPrefix = "LC08/01/001/002/LC08_L1GT_001002_20160817_20170322_01_T2/";
2057+
String landsatBlob = landsatPrefix + "LC08_L1GT_001002_20160817_20170322_01_T2_ANG.txt";
20582058
byte[] bytes = unauthorizedStorage.readAllBytes(landsatBucket, landsatBlob);
20592059

2060-
assertThat(bytes.length).isEqualTo(7903);
2060+
assertThat(bytes.length).isEqualTo(117255);
20612061
int numBlobs = 0;
20622062
Iterator<Blob> blobIterator =
20632063
unauthorizedStorage
@@ -2068,7 +2068,7 @@ public void testDownloadPublicBlobWithoutAuthentication() {
20682068
numBlobs++;
20692069
blobIterator.next();
20702070
}
2071-
assertThat(numBlobs).isEqualTo(13);
2071+
assertThat(numBlobs).isEqualTo(14);
20722072

20732073
// try to download blobs from a bucket that requires authentication
20742074
// authenticated client will succeed
@@ -3291,7 +3291,7 @@ public void testBlobReload() throws Exception {
32913291
fail("StorageException was expected");
32923292
} catch (StorageException e) {
32933293
assertEquals(412, e.getCode());
3294-
assertEquals("Precondition Failed", e.getMessage());
3294+
assertEquals("conditionNotMet", e.getReason());
32953295
}
32963296

32973297
Blob updated = blob.reload();

0 commit comments

Comments
 (0)