fgreg closed pull request #9: SDAP-107 Ningester container does not report exit 
code correctly
URL: https://github.com/apache/incubator-sdap-ningester/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 void testUnsuccessfulMatch() {
         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() {
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to