This is an automated email from the ASF dual-hosted git repository.
fgreg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ningester.git
The following commit(s) were added to refs/heads/master by this push:
new bc596c2 SDAP-107 Ningester container does not report exit code
correctly
bc596c2 is described below
commit bc596c2749a7a2b44a01558b60428f6d008f4f45
Author: fgreg <[email protected]>
AuthorDate: Thu Jun 14 09:35:01 2018 -0700
SDAP-107 Ningester container does not report exit code correctly
Now using `set -o pipefail` in entrypoint script.
---
docker/entrypoint.sh | 5 +++++
.../processors/AddDayOfYearAttributeTest.java | 22 ++++++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index ae80a4c..1f12ef4 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -13,7 +13,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
+# Exit immediately if a simple command returns non-zero exit code
+# Cause the status of terminated background jobs to be reported immediately.
set -eb
+# With pipefail, the return status of a pipeline is "the value of the last
(rightmost) command to exit with a non-zero status, or zero if all commands
exit successfully"
+set -o pipefail
NINGESTER_JAR=`find ningester/build/libs -name ningester*.jar`
CONFIG_FILES=`find /config -name "*.yml" | awk -vORS=, '{ print $1 }'`
diff --git
a/src/test/java/org/apache/sdap/ningester/processors/AddDayOfYearAttributeTest.java
b/src/test/java/org/apache/sdap/ningester/processors/AddDayOfYearAttributeTest.java
index a6aef61..60c8092 100644
---
a/src/test/java/org/apache/sdap/ningester/processors/AddDayOfYearAttributeTest.java
+++
b/src/test/java/org/apache/sdap/ningester/processors/AddDayOfYearAttributeTest.java
@@ -75,6 +75,28 @@ public class AddDayOfYearAttributeTest {
processor.setDayOfYearFromGranuleName(nexusTile);
}
+ @Test
+ public void testSuccessfulMatchSmap() {
+ String regex = "^sss_smap_L3m_clim_doy(\\d{3}).*";
+ String granuleName =
"file:/some/path/sss_smap_L3m_clim_doy227_month08_nepochs1_pixelMean.nc";
+ NexusTile nexusTile = NexusTile.newBuilder().setSummary(
+ TileSummary.newBuilder()
+ .setGranule(granuleName)
+ .build()
+ ).build();
+
+ AddDayOfYearAttribute processor = new AddDayOfYearAttribute(regex);
+
+ NexusTile result = processor.setDayOfYearFromGranuleName(nexusTile);
+
+ assertThat(result.getSummary().getGlobalAttributesList(), contains(
+ hasProperty("name", is("day_of_year_i"))
+ ));
+
+ String actualDayOfYear =
result.getSummary().getGlobalAttributes(0).getValues(0);
+ assertThat(actualDayOfYear, is("227"));
+ }
+
@Test()
public void testUnsuccessfulGroupMatch() {
--
To stop receiving notification emails like this one, please contact
[email protected].