Skip to content

Commit

Permalink
Revising custom Job Exists method (Azure#3602)
Browse files Browse the repository at this point in the history
* Code gen for ADLA

* This change is mapped to this PR:
Azure/azure-rest-api-specs#1429

* This commit is for ADLA

* Code gen for ADLS

* This change is mapped to this PR:
Azure/azure-rest-api-specs#1429

* This commit for ADLS

* Code gen for ADLS (part 2)

* I missed this file!

* Code gen for ADL (part 3)

* Updating to the correct commit number:
Azure/azure-rest-api-specs#1452

* Update Azure Batch to 5.1.0 (Azure#3513)

* Fixing publishing of symbols. Fixing issue# 3518 (Azure#3519)

* Fix Batch changelog references (Azure#3517)

* Do hydra to swagger specs migration for azure-sdk-for-net (Azure#3482)

* Do hydra to swagger specs migration for azure-sdk-for-net

* Fix build failed problem

* update the assemblyinfo file with the updated version 2.6.0

* Revert "update the assemblyinfo file with the updated version 2.6.0"

This reverts commit a33beb0.

* Updata the AssemblyFileVersion to 2.6.0.0

* revert package version

* Make project files concise.

* Add Provider test case

* update the pr with new tests with session records

* remove extra code

* Fixing changelog.md

* Fixing up changelog.md

* [DataLake Analytics] Fixing changelog.md

More descriptive and fixing indent issue that was not addressed in the previous commit

* [DataLake Store] Fixing changelog.md

More descriptive and fixing indent issue not addressed in a previous commit

* [DataLake Analytics] Fixing changelog.md

Adding an important note about retrieving a list of jobs and accounts

* Revising custom Job Exists method

* Ran into two regressions in JobOperationTests.cs
* The custom Job Exists method is expecting a non-empty response body to
validate non-existence.  After speaking with a team member who
implemented the service, I can no longer rely on this.  Thus, I am
removing the logic that checks for a non-empty response body.
* Commenting out the test case for listing Jobs with a select parameter.
This is currently being fixed.

* Adding a TODO comment

* Adding this as a reminder to re-enable the test
  • Loading branch information
ro-joowan authored and shahabhijeet committed Aug 21, 2017
1 parent 2297bfd commit 1c93181
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void SubmitGetListCancelTest()
Assert.NotNull(compileResponse);

// now compile a broken job and verify diagnostics report an error
jobToSubmit.Properties.Script = "DROP DATABASE IF EXIST FOO; CREATE DATABASE FOO;";
jobToBuild.Properties.Script = "DROP DATABASE IF EXIST FOO; CREATE DATABASE FOO;";
compileResponse = clientToUse.Job.Build(commonData.SecondDataLakeAnalyticsAccountName, jobToBuild);
Assert.NotNull(compileResponse);

Expand All @@ -174,11 +174,12 @@ public void SubmitGetListCancelTest()
Assert.Equal(1, ((USqlJobProperties)compileResponse.Properties).Diagnostics[0].LineNumber);
Assert.Contains("E_CSC_USER_SYNTAXERROR", ((USqlJobProperties)compileResponse.Properties).Diagnostics[0].Message);

// TODO: re-enable this when the server side is fixed
// list the jobs both with a hand crafted query string and using the parameters
listJobResponse = clientToUse.Job.List(commonData.SecondDataLakeAnalyticsAccountName, select: "jobId" );
Assert.NotNull(listJobResponse);
// listJobResponse = clientToUse.Job.List(commonData.SecondDataLakeAnalyticsAccountName, select: "jobId" );
// Assert.NotNull(listJobResponse);

Assert.True(listJobResponse.Any(job => job.JobId == getJobResponse.JobId));
// Assert.True(listJobResponse.Any(job => job.JobId == getJobResponse.JobId));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,22 @@ internal partial class JobOperations : IServiceOperations<DataLakeAnalyticsJobMa
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;

if (_httpResponse.StatusCode == HttpStatusCode.NotFound && ex.Body.Code.Equals("JobNotFound", StringComparison.OrdinalIgnoreCase))
}
if (_httpResponse.StatusCode == HttpStatusCode.NotFound)
{
var _toReturn = new AzureOperationResponse<bool>();
_toReturn.Request = _httpRequest;
_toReturn.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
var _toReturn = new AzureOperationResponse<bool>();
_toReturn.Request = _httpRequest;
_toReturn.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_toReturn.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
_toReturn.Body = false;
_toReturn.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
_toReturn.Body = false;

if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _toReturn);
}
return _toReturn;
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _toReturn);
}
return _toReturn;
}
}
}
Expand Down

0 comments on commit 1c93181

Please sign in to comment.