Sfoglia il codice sorgente

Merge pull request #3212 from rengolin/regression

gh-2879 Add spray test

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 anni fa
parent
commit
b7f27c7c71

+ 2 - 3
testing/ecl/Regress/Engine.pm

@@ -465,10 +465,9 @@ sub _check_ini_file($)
     my $passwd = ''; # This will be asked during runtime
     my $parallel = '0'; # This can be set via command line
 
-    # Variables not present in xsl or xml. How to get them?
+    # Variables not present in xsl or xml
     my $purge = 'move';
-    my $fileloc = '';
-    my $eclPublish;
+    my $fileloc = getcwd();
 
     # Format to INI
     my $ini = new Config::Simple(syntax=>'ini');

+ 5 - 0
testing/ecl/key/spray_test.xml

@@ -0,0 +1,5 @@
+<Dataset name='Result 1'>
+ <Row><name>foo</name><age>10</age><good>true</good></Row>
+ <Row><name>bar</name><age>12</age><good>false</good></Row>
+ <Row><name>baz</name><age>32</age><good>true</good></Row>
+</Dataset>

+ 46 - 0
testing/ecl/spray_test.ecl

@@ -0,0 +1,46 @@
+/*##############################################################################
+
+    Copyright (C) 2012 HPCC Systems.
+
+    All rights reserved. This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as
+    published by the Free Software Foundation, either version 3 of the
+    License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+############################################################################## */
+
+import Std.File AS FileServices;
+
+// This is not an engine test, but a DFU.
+// Doesn't matter much which engine does it, so we restrict to only one
+
+//noRoxie
+//noThorLCR
+//noThor
+
+SrcIP := 'localhost';
+File := setupTextFileLocation + '/spray_test.txt';
+RecordSize := 11;
+ClusterName := 'mythor';
+DestFile := '~regress::spray_test.txt';
+Timeout := -1;
+ESPportIP := 'http://127.0.0.1:8010/FileSpray';
+
+FileServices.SprayFixed(SrcIP,
+                        File,
+                        RecordSize,
+                        ClusterName,
+                        DestFile,
+                        Timeout,
+                        ESPportIP,
+                        ALLOWOVERWRITE := true);
+
+ds := DATASET(DestFile, { string name, unsigned age, boolean good }, csv);
+output(ds);

+ 3 - 0
testing/ecl/spray_test.txt

@@ -0,0 +1,3 @@
+foo, 10, 1
+bar, 12, 0
+baz, 32, 1