Skip to content

Commit

Permalink
updated e2e testscript and removed gremlin code
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokun-niu committed Dec 3, 2024
1 parent 7ed82d0 commit 7894c69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 1 addition & 3 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"main": "index.js",
"scripts": {
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --detectOpenHandles",
"test:ci": "jest --reporters=default --reporters=jest-junit --detectOpenHandles",
"test:gremlin": "jest 03-gremlin-reaction-scenario/gremlin-reaction.test.js --detectOpenHandles",
"test:storedproc": "jest 02-storedproc-scenario/storedproc.test.js --detectOpenHandles"
"test:ci": "jest --reporters=default --reporters=jest-junit --detectOpenHandles"
},
"jest-junit": {
"suiteNameTemplate": "{filepath}",
Expand Down
15 changes: 3 additions & 12 deletions reactions/gremlin/gremlin-reaction/Services/GremlinService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void ProcessAddedQueryResults(Dictionary<string, object> res)
Dictionary<string, object> addedResultCommandParams = new Dictionary<string, object>();


foreach (var param in _addedResultCommandParamList)
foreach (string param in _addedResultCommandParamList)
{
// Prepare the parameterized query by removing the @ sign
newCmd = newCmd.Replace($"@{param}", param);
Expand Down Expand Up @@ -174,7 +174,7 @@ public void ProcessUpdatedQueryResults(UpdatedResultElement updatedResult)

Dictionary<string, object> updatedResultCommandParams = new Dictionary<string, object>();

foreach (var param in _updatedResultCommandParamList)
foreach (string param in _updatedResultCommandParamList)
{
if (param.StartsWith("before"))
{
Expand Down Expand Up @@ -218,7 +218,7 @@ public void ProcessDeletedQueryResults(Dictionary<string, object> deletedResults
Dictionary<string, object> deletedResultCommandParams = new Dictionary<string, object>();


foreach (var param in _deletedResultCommandParamList)
foreach (string param in _deletedResultCommandParamList)
{
// Prepare the parameterized query by removing the @ sign
newCmd = newCmd.Replace($"@{param}", param);
Expand Down Expand Up @@ -292,7 +292,6 @@ private async Task<ResultSet<dynamic>> SubmitRequest(GremlinClient gremlinClient
// x-ms-retry-after-ms : The number of milliseconds to wait to retry the operation after an initial operation was throttled. This will be populated when
// : attribute 'x-ms-status-code' returns 429.
// x-ms-activity-id : Represents a unique identifier for the operation. Commonly used for troubleshooting purposes.
PrintStatusAttributes(e.StatusAttributes);
_logger.LogInformation($"\t[\"x-ms-retry-after-ms\"] : {GetValueAsString(e.StatusAttributes, "x-ms-retry-after-ms")}");
_logger.LogInformation($"\t[\"x-ms-activity-id\"] : {GetValueAsString(e.StatusAttributes, "x-ms-activity-id")}");

Expand All @@ -305,14 +304,6 @@ string GetValueAsString(IReadOnlyDictionary<string, object> dictionary, string k
return JsonSerializer.Serialize(GetValueOrDefault(dictionary, key));
}

// Print the common StatusAttributes from a ResponseException
void PrintStatusAttributes(IReadOnlyDictionary<string, object> attributes)
{
_logger.LogInformation($"\tStatusAttributes:");
_logger.LogInformation($"\t[\"x-ms-status-code\"] : {GetValueAsString(attributes, "x-ms-status-code")}");
_logger.LogInformation($"\t[\"x-ms-total-server-time-ms\"] : {GetValueAsString(attributes, "x-ms-total-server-time-ms")}");
_logger.LogInformation($"\t[\"x-ms-total-request-charge\"] : {GetValueAsString(attributes, "x-ms-total-request-charge")}");
}
object GetValueOrDefault(IReadOnlyDictionary<string, object> dictionary, string key)
{
if (dictionary.ContainsKey(key))
Expand Down

0 comments on commit 7894c69

Please sign in to comment.