Enabling Node SDK with new test framework#491
Draft
sagar-okta wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: https://oktainc.atlassian.net/browse/OKTA-1158624
The Node.js SDK has no auto-generated integration test infrastructure. Tests must be written manually, making it difficult to maintain coverage as the API surface grows.
What is the new behavior?
Introduces a generated test framework for the Okta Node.js SDK, mirroring the pattern used in the Java SDK (OKTA-1103933).
New files:
test-setup.sh— Orchestration script with three phases:setup(terraform init + apply),test(run generated tests with TF outputs injected),destroy(terraform teardown). Usage:bash test-setup.sh [setup|test|destroy|all]scripts/generate-tests.sh— Docker-based script that generates test files from the OpenAPI spec (spec/management.yaml) usingopenapitools/openapi-generator-cli:v7.13.0and copies them tosrc/generated/tests/templates/openapi-generator/api/api_test.mustache— Mustache template for generating per-API test files. Tests use aPresetHelperto resolve Terraform outputs into prerequisite data for each operation.templates/swagger-codegen-tests-config.json— Codegen configuration for test generationokta-config.yaml.example— Template for local credentials file (the actualokta-config.yamlis gitignored)Modified files:
.gitignore— Addsokta-config.yaml(credentials),src/generated/tests/(generated files),tmp_test_gen/(temp build dir),test/generated/utils.js.eslintignore— Addssrc/generated/tests/to prevent linting auto-generated filespackage.json— Adds two new scripts:generate:tests— runsscripts/generate-tests.shto regenerate test files from spectest:generated— runs all generated tests via mochaLocal setup (not committed):
okta-config.yaml— Local credentials file (gitignored)terraform/— Per-API Terraform directories for provisioning test prerequisites (not committed, must be sourced separately)Does this PR introduce a breaking change?
Other information
To run the generated tests locally:
okta-config.yaml.exampletookta-config.yamland fill in credentialsterraform/directory in the repo root (sourced from the test infrastructure repo)yarn generate:teststo generate test files from the specbash test-setup.sh allto provision resources, run tests, and destroyThe
src/generated/tests/directory is gitignored — test files are always regenerated from the spec at runtime.Reviewers