You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/08/26 23:19:59 UTC

[1/4] git commit: CLIMATE-355 - Remove outdated evaluation run test

Repository: climate
Updated Branches:
  refs/heads/master ab51ff651 -> fb37845c2


CLIMATE-355 - Remove outdated evaluation run test


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/38f7ba8d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/38f7ba8d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/38f7ba8d

Branch: refs/heads/master
Commit: 38f7ba8dc3a18b08c95152ab2f6a2b44ddb7f623
Parents: ab51ff6
Author: Michael Joyce <jo...@apache.org>
Authored: Tue Aug 26 12:30:00 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Tue Aug 26 12:30:00 2014 -0700

----------------------------------------------------------------------
 .../test/spec/controllers/parameterselect.js    | 102 -------------------
 1 file changed, 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/38f7ba8d/ocw-ui/frontend-new/test/spec/controllers/parameterselect.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend-new/test/spec/controllers/parameterselect.js b/ocw-ui/frontend-new/test/spec/controllers/parameterselect.js
index e67b8df..aa4cbd8 100644
--- a/ocw-ui/frontend-new/test/spec/controllers/parameterselect.js
+++ b/ocw-ui/frontend-new/test/spec/controllers/parameterselect.js
@@ -133,106 +133,4 @@ describe('Controller: ParameterSelectCtrl', function () {
       expect(scope.displayParams.end).toBe('2030-01-01 00:00:00');
   });
   */
-
-  /*
-   * TODO: The backend call for this expects completely different data formats.
-   * Additionally, there are many more URLs to mock now. Something has definitely
-   * changed with how httpBackend functions or the way the code base is setup.
-   */
-  /*
-  it('should properly set the results of running an evaluation', function() {
-    inject(function($rootScope, $controller, $httpBackend) {
-      var scope = $rootScope.$new();
-      var ctrl = $controller("ParameterSelectCtrl", {$scope: scope});
-
-      // Seed rootScope with a known URL for test queries and holder for eval results
-      $rootScope.baseURL = "http://localhost:9876";
-      $rootScope.evalResults = {};
-
-      // Seed the displayParams so the query is properly formatted
-      scope.displayParams.lonMin = -180;
-      scope.displayParams.lonMax = 180;
-      scope.displayParams.latMin = -90;
-      scope.displayParams.latMax = 90;
-      scope.displayParams.start = "1980-01-01";
-      scope.displayParams.end = "2030-01-01";
-
-      // The expected URL string that the frontend generates given this example set
-      var urlString = "http://localhost:9876/rcmes/run/?" + 
-        "callback=JSON_CALLBACK&" + 
-        "endTime=2030-01-01%2000%3A00%3A00&" +
-        "filelist=%2Fusr%2Flocal%2Frcmes%2FmodelsForUI%2Fprec.HRM3.ncep.monavg.nc&" +
-        "latMax=90&" +
-        "latMin=-90&" +
-        "lonMax=180&" +
-        "lonMin=-180&" +
-        "metricOption=bias&" +
-        "modelLatVarName=lat&" +
-        "modelLonVarName=lon&" +
-        "modelTimeVarName=time&" +
-        "modelVarName=prec&" +
-        "obsDatasetId=3&" +
-        "obsParameterId=36&" +
-        "regridOption=model&" +
-        "startTime=1980-01-01%2000%3A00%3A00&" +
-        "timeRegridOption=monthly";
-
-      // Example dataset configuration for the test.
-      scope.datasets = [
-        {
-          "isObs"         : 1,
-          "id"            : "3",
-          "name"          : "Tropical Rainfall Measuring Mission Dataset",
-          "param"         : "36",
-          "paramName"     : "TRMM v.6 Monthly Precipitation",
-          "latlonVals"    : {"latMin" : -90, "latMax" : 90, "lonMin" : -180, "lonMax" : 180},
-          "lat"           : "N/A",
-          "lon"           : "N/A",
-          "timeVals"      : {"start" : "1998-01-01 00:00:00",
-          "end"           : "2010-01-01 00:00:00"},
-          "time"          : "N/A",
-          "shouldDisplay" : true,
-          "regrid"        : false
-          },{
-          "isObs"         : 0,
-          "id"            : "/usr/local/rcmes/modelsForUI/prec.HRM3.ncep.monavg.nc",
-          "name"          : "prec.HRM3.ncep.monavg.nc",
-          "param"         : "prec",
-          "paramName"     : "prec",
-          "lat"           : "lat",
-          "lon"           : "lon",
-          "latlonVals"    : {"latMin" : "15.25",
-          "latMax"        : "75.25",
-          "lonMin"        : "-159.75",
-          "lonMax"        : "-29.75"},
-          "time"          : "time",
-          "timeVals"      : {"start":"1980-01-01 00:00:00",
-          "end"           : "2004-12-01 00:00:00"},
-          "shouldDisplay" : true,
-          "regrid"        : false
-        }
-      ];
-
-      $httpBackend.expectGET('http://localhost:8082/processing/metrics/').respond(
-        200, {'data': {'metrics': ['foo', 'bar']}}
-      )
-      $httpBackend.expectPOST('http://localhost:9876/processing/run_evaluation/').respond(200) 
-      $httpBackend.expectGET('views/main.html').respond(200)
-      $httpBackend.expectJSONP(urlString).respond(200, 
-          {'comparisonPath': '/fake/path1', 
-           'modelPath': '/fake/path2', 
-           'obsPath': '/fake/path3'});
-
-      console.log('here')
-      scope.runEvaluation();
-      console.log('here1')
-      $httpBackend.flush();
-      console.log('here2')
-
-      expect($rootScope.evalResults.comparisonPath).toBe('path1');
-      expect($rootScope.evalResults.modelPath).toBe('path2');
-      expect($rootScope.evalResults.obsPath).toBe('path3');
-    });
-  });
-  */
 });


[4/4] git commit: Resolve CLIMATE-355. Merge PR #104.

Posted by jo...@apache.org.
Resolve CLIMATE-355. Merge PR #104.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/fb37845c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/fb37845c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/fb37845c

Branch: refs/heads/master
Commit: fb37845c2b1dd50315419a8b882be88a9097b546
Parents: ab51ff6 1866ad5
Author: Michael Joyce <jo...@apache.org>
Authored: Tue Aug 26 14:19:15 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Tue Aug 26 14:19:15 2014 -0700

----------------------------------------------------------------------
 .../scripts/controllers/observationselect.js    |   4 +-
 .../test/spec/controllers/observationselect.js  |  37 +++----
 .../test/spec/controllers/parameterselect.js    | 102 -------------------
 3 files changed, 16 insertions(+), 127 deletions(-)
----------------------------------------------------------------------



[2/4] git commit: CLIMATE-355 - Minor ObservationSelect ctrl cleanup for test fixes

Posted by jo...@apache.org.
CLIMATE-355 - Minor ObservationSelect ctrl cleanup for test fixes


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/32f4dde7
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/32f4dde7
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/32f4dde7

Branch: refs/heads/master
Commit: 32f4dde7e00817dbd4b08c1dd2391f9b916aa274
Parents: 38f7ba8
Author: Michael Joyce <jo...@apache.org>
Authored: Tue Aug 26 12:46:21 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Tue Aug 26 12:46:21 2014 -0700

----------------------------------------------------------------------
 ocw-ui/frontend-new/app/scripts/controllers/observationselect.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/32f4dde7/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js b/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js
index 696c8b1..6dfbb57 100644
--- a/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js
+++ b/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js
@@ -43,7 +43,7 @@ angular.module('ocwUiApp')
     $scope.timeSelect  = $scope.times[0];
 
     // Grab the path leader information that the webserver is using to limit directory access.
-    $scope.pathLeader = 'False';
+    $scope.pathLeader = false;
     $http.jsonp($rootScope.baseURL + '/dir/path_leader/?callback=JSON_CALLBACK').
       success(function(data) {
       $scope.pathLeader = data.leader;
@@ -72,7 +72,7 @@ angular.module('ocwUiApp')
 
       // If the backend is limiting directory access we need to add that leader to our path
       // so it remains valid!
-      if ($scope.pathLeader != 'False') {
+      if ($scope.pathLeader) {
         input = $scope.pathLeader + input
       }
 


[3/4] git commit: CLIMATE-355 - Fix ObservationSelectCtlr tests

Posted by jo...@apache.org.
CLIMATE-355 - Fix ObservationSelectCtlr tests

- Update all backend URLs to use the newly refactored backend API.
- Update httpBackend handling to ensure that all encountered URLs are
  properly captured.
- Update LFME backend URL calls to be less verbose and to return
  properly formated mocked data that matches the returned values from
  the refactored backend.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/1866ad5d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/1866ad5d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/1866ad5d

Branch: refs/heads/master
Commit: 1866ad5d056009fac889bce87f752646dbfb3ef0
Parents: 32f4dde
Author: Michael Joyce <jo...@apache.org>
Authored: Tue Aug 26 12:46:48 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Tue Aug 26 12:46:48 2014 -0700

----------------------------------------------------------------------
 .../test/spec/controllers/observationselect.js  | 37 ++++++++------------
 1 file changed, 14 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/1866ad5d/ocw-ui/frontend-new/test/spec/controllers/observationselect.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend-new/test/spec/controllers/observationselect.js b/ocw-ui/frontend-new/test/spec/controllers/observationselect.js
index 7490144..f544e22 100644
--- a/ocw-ui/frontend-new/test/spec/controllers/observationselect.js
+++ b/ocw-ui/frontend-new/test/spec/controllers/observationselect.js
@@ -52,18 +52,15 @@ describe('Controller: ObservationSelectCtrl', function () {
     expect(scope.times[0]).toEqual("Please select a file above");
   });
 
-  /*
   it('should initialize scope attributes properly', function() {
     inject(function($httpBackend, $rootScope, $controller) {
       $rootScope.baseURL = "http://localhost:8082"
-      $httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK').
-        respond(200, {'leader': '/usr/local/rcmes'});
-
-      var scope = $rootScope.$new();
-      var ctrl = $controller("ObservationSelectCtrl", {$scope: scope});
+      $httpBackend.expectJSONP($rootScope.baseURL + '/dir/path_leader/?callback=JSON_CALLBACK').
+        respond(200, {'leader': '/usr/local/ocw'});
+      $httpBackend.whenGET('views/main.html').respond(200);
       $httpBackend.flush();
 
-      expect(scope.pathLeader).toEqual('/usr/local/rcmes');
+      expect(scope.pathLeader).toEqual('/usr/local/ocw');
       expect(scope.loadingFile).toBe(false);
       expect(scope.fileAdded).toBe(false);
       expect(typeof scope.latLonVals).toEqual('object');
@@ -74,25 +71,20 @@ describe('Controller: ObservationSelectCtrl', function () {
       expect(Object.keys(scope.localSelectForm).length).toEqual(0);
     });
   });
-  */
 
-  /*
   it('should initialize the uploadLocalFile function', function() {
     inject(function($httpBackend, $rootScope, $controller) {
       $rootScope.baseURL = "http://localhost:8082"
       $httpBackend.expectJSONP($rootScope.baseURL + '/dir/path_leader/?callback=JSON_CALLBACK').
-        respond(200, {'leader': '/usr/local/rcmes'});
-
-      var scope = $rootScope.$new();
-      var ctrl = $controller("ObservationSelectCtrl", {$scope: scope});
-      $httpBackend.flush();
+        respond(200, {'leader': null});
+      $httpBackend.whenGET('views/main.html').respond(200);
 
-      $httpBackend.expectJSONP($rootScope.baseURL + '/list/vars/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK').
+      $httpBackend.expectJSONP($rootScope.baseURL + '/lfme/list_vars/undefined?callback=JSON_CALLBACK').
         respond(200, {"variables": ["lat", "lon", "prec", "time" ]});
-      $httpBackend.expectJSONP($rootScope.baseURL + '/list/latlon/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK').
-        respond(200, {'latMax': '75.25', 'success': 1, 'latname': 'lat', 'lonMax': '-29.75', 'lonMin': '-159.75', 'lonname': 'lon', 'latMin': '15.25'});
-      $httpBackend.expectJSONP($rootScope.baseURL + '/list/time/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK').
-        respond(200, {"start_time": "1980-01-01 00:00:00", "timename": "time", "success": 1, "end_time": "2004-12-01 00:00:00"});
+      $httpBackend.expectJSONP($rootScope.baseURL + '/lfme/list_latlon/undefined?callback=JSON_CALLBACK').
+        respond(200, {'latMax': '75.25', 'success': 1, 'lat_name': 'lat', 'lonMax': '-29.75', 'lonMin': '-159.75', 'lon_name': 'lon', 'latMin': '15.25'});
+      $httpBackend.expectJSONP($rootScope.baseURL + '/lfme/list_time/undefined?callback=JSON_CALLBACK').
+        respond(200, {"start_time": "1980-01-01 00:00:00", "time_name": "time", "success": 1, "end_time": "2004-12-01 00:00:00"});
 
       scope.uploadLocalFile();
       $httpBackend.flush();
@@ -103,11 +95,11 @@ describe('Controller: ObservationSelectCtrl', function () {
       expect(scope.paramSelect).toEqual("prec");
 
       // Simulate failure on one of the backend calls. Should
-      $httpBackend.expectJSONP($rootScope.baseURL + '/list/vars/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK').
+      $httpBackend.expectJSONP($rootScope.baseURL + '/lfme/list_vars/undefined?callback=JSON_CALLBACK').
         respond(200, {});
-      $httpBackend.expectJSONP($rootScope.baseURL + '/list/latlon/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK').
+      $httpBackend.expectJSONP($rootScope.baseURL + '/lfme/list_latlon/undefined?callback=JSON_CALLBACK').
         respond(404, {});
-      $httpBackend.expectJSONP($rootScope.baseURL + '/list/time/"/usr/local/rcmesundefined"?callback=JSON_CALLBACK').
+      $httpBackend.expectJSONP($rootScope.baseURL + '/lfme/list_time/undefined?callback=JSON_CALLBACK').
         respond(200, {});
 
       scope.uploadLocalFile();
@@ -123,7 +115,6 @@ describe('Controller: ObservationSelectCtrl', function () {
       expect(scope.times.length).toEqual(1);
     });
   });
-  */
 
   it('should initialize the addDatasets function', function() {
     expect(typeof(scope.addDataSet)).toBe("function");