Skip to content

Commit

Permalink
more ci/cd restoration and removing commented out debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Hodges committed Sep 7, 2023
1 parent 8e6450e commit 5e1b2ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 38 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
with:
owner: 'smartsheet'
repository: 'smartsheet-sdk-tests'
#- name: Setup Mock API
# run: |
# smartsheet-sdk-tests/ci_scripts/install_wiremock.sh
# smartsheet-sdk-tests/ci_scripts/start_wiremock.sh
#- name: Run Mock API Tests
# working-directory: ./mock-api-test-sdk-net60
# run: |
# dotnet build --configuration Release --no-restore
# dotnet test --no-restore
- name: Setup Mock API
run: |
smartsheet-sdk-tests/ci_scripts/install_wiremock.sh
smartsheet-sdk-tests/ci_scripts/start_wiremock.sh
- name: Run Mock API Tests
working-directory: ./mock-api-test-sdk-net60
run: |
dotnet build --configuration Release --no-restore
dotnet test --no-restore
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,8 @@ private async Task<HttpResponse> RequestAsync(HttpRequest smartsheetRequest)
restRequest.AddHeader(header.Key, header.Value);
}
}
Boolean bodyAdded = false;
if (smartsheetRequest.Entity != null && smartsheetRequest.Entity.GetContent() != null)
{
bodyAdded = true;

restRequest.AddHeader("Content-Type", "application/json");

Expand Down Expand Up @@ -282,36 +280,12 @@ private async Task<HttpResponse> RequestAsync(HttpRequest smartsheetRequest)
timer.Stop();

LogRequest(restRequest, restResponse, timer.ElapsedMilliseconds);
/*

if (restResponse.ResponseStatus == ResponseStatus.Error)
{
Boolean restClientDebugging = false;
if (restClientDebugging) {
StringBuilder builder = new StringBuilder();
builder.Append(" Smartsheet request URI is " + smartsheetRequest.Uri + "\n");
foreach (KeyValuePair<string, string> header in smartsheetRequest.Headers)
{
builder.Append("Headers: " + "\n");
builder.Append("Key: " + header.Key + " Value: " + header.Value + "\n");
}
builder.Append(" Smartsheet request method is " + smartsheetRequest.Method + "\n");
builder.Append(" Was there a body added??? " + bodyAdded.ToString() + "\n");
if (smartsheetRequest.Entity != null) {
builder.Append(" Was there a body entity content type: " + smartsheetRequest.Entity.ContentType + "\n");
builder.Append(" Was there a body entity as string : " + smartsheetRequest.Entity.GetContentAsString() + "\n");
}
builder.Append(" There was an issue connecting.");
builder.Append(" RestResponse code is " + restResponse.StatusCode.ToString() + "\n");
builder.Append(" RestResponse ErrorMessage is " + restResponse.ErrorMessage + "\n");
builder.Append(" RestResponse Content is " + restResponse.Content + "\n");
throw new HttpClientException("There was an issue connecting.);
}

throw new HttpClientException(builder.ToString());
} else {
throw new HttpClientException("There was an issue connecting. Error response: " + restResponse.ErrorMessage);
}
} */

// Set returned Headers
smartsheetResponse.Headers = new Dictionary<string, string>();
Expand Down

0 comments on commit 5e1b2ab

Please sign in to comment.