Skip to content

Update rest tests for non-zero shard/realm #11513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jnels124
Copy link
Contributor

@jnels124 jnels124 commented Jul 3, 2025

Description:

  • replace hardcoded shard/realm in spec tests at runtime
  • update integration tests to work with configured shard/realm

Related issue(s):

Fixes #10744

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

jnels124 added 4 commits June 27, 2025 01:28
Signed-off-by: Jesse Nelson <[email protected]>
Signed-off-by: Jesse Nelson <[email protected]>
Signed-off-by: Jesse Nelson <[email protected]>
Signed-off-by: Jesse Nelson <[email protected]>
@lfdt-bot
Copy link

lfdt-bot commented Jul 3, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

result.push(entry);
}

return result.join('&').replace('&', '?');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High test

This replaces only the first occurrence of '&'.

Copilot Autofix

AI 1 day ago

To fix the issue, we need to ensure that all occurrences of '&' in the string are replaced. This can be achieved by using a regular expression with the global (g) flag instead of a string literal as the first argument to replace. Specifically, the string '&' should be replaced with a regular expression /&/g. This change ensures that every occurrence of '&' in the string is replaced.


Suggested changeset 1
rest/__tests__/integrationUtils.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/rest/__tests__/integrationUtils.js b/rest/__tests__/integrationUtils.js
--- a/rest/__tests__/integrationUtils.js
+++ b/rest/__tests__/integrationUtils.js
@@ -76,3 +76,3 @@
 
-    return result.join('&').replace('&', '?');
+    return result.join('&').replace(/&/g, '?');
   } else {
EOF
@@ -76,3 +76,3 @@

return result.join('&').replace('&', '?');
return result.join('&').replace(/&/g, '?');
} else {
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run unit and integration tests with non-zero realms
2 participants