Skip to content

Comments

Introduce new scenarios testing framework#4895

Open
MicroFish91 wants to merge 27 commits intomainfrom
mwf/test-scenarios-framework
Open

Introduce new scenarios testing framework#4895
MicroFish91 wants to merge 27 commits intomainfrom
mwf/test-scenarios-framework

Conversation

@MicroFish91
Copy link
Contributor

@MicroFish91 MicroFish91 commented Jan 22, 2026

Overview

This introduces a new test framework that I’d like us to start leveraging to gain better visibility into how the wide range of app configurations impacts deployment health across different project types.

For a deeper dive into the what and why, see the full write-up here:
https://github.com/microsoft/azcode-internal/issues/231

If you’d rather jump straight to a high-level overview of the design, this diagram and the accompanying type definitions capture the core flow of the implementation:
test/nightly/scenarios/testScenarios/AzExtFunctionsTestScenario.ts

As far as I can tell, this change doesn’t introduce any breaking changes to existing tests. That said, there are already some failing tests, so it’s difficult to be completely certain. I think we should definitely do a deeper pass on the older tests—both to fix what’s broken and to evaluate which ones are still necessary versus which could be effectively replaced by the new coverage introduced here.

Output

Basic

image

Extended

image

Todos

  • Add pretest logic to download and install:
    • Node
    • .NET
    • Python
  • Hook up environment variable(s) so that extended tests can be manually run in the remote pipelines
  • Create Copilot skills so engineers can quickly draft new scenarios in the future


ext.outputChannel = new TestOutputChannel();

registerAppServiceExtensionVariables(ext);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Remove when migrating to es build

const folderName = path.basename(workspacePath);
assert.equal(folderName, String(i), `Unexpected workspace folder name "${folderName}".`);
// const folderName = path.basename(workspacePath);
// assert.equal(folderName, String(i), `Unexpected workspace folder name "${folderName}".`);
Copy link
Contributor Author

@MicroFish91 MicroFish91 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this assertion needed?

* │
* ┌────────┴────────┐
* │ Create New │
* │ Project │
Copy link
Contributor Author

@MicroFish91 MicroFish91 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had Copilot help me draft a lot of the documentation / comments. Let me know if it's too overkill, I'm happy to pare it down if needed.

"AZFUNC_UPDATE_BACKUP_TEMPLATES": "",
"AzCode_EnableLongRunningTestsLocal": "",
"AzCode_EnableLongRunningTestsLocal": "true",
"AzCode_RunScenarioExtended": "durable-azurestorage-jsnode"
Copy link
Contributor Author

@MicroFish91 MicroFish91 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: Unset these before merging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default nightly run would test with AzCode_RunScenarioExtended not set to anything**


const testScenarios: AzExtFunctionsParallelTestScenario[] = generateParallelScenarios();

suite.only('Scenarios', async function (this: Mocha.Suite) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Remove .only before merging

/**
* A wrapper for {@link AzExtFunctionsTestScenario}. Prepares a scenario for concurrent test execution.
*/
export interface AzExtFunctionsParallelTestScenario {
Copy link
Contributor Author

@MicroFish91 MicroFish91 Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not truly "parallel", but felt like just following the naming convention we're already using for concurrent tests. I think it's implicitly understood.

@MicroFish91 MicroFish91 marked this pull request as ready for review January 27, 2026 00:34
@MicroFish91 MicroFish91 requested a review from a team as a code owner January 27, 2026 00:34
this.updateTestStatus(deployFunctionAppTest, 'fail', error);
}

report(): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a standard test reporter? Mocha has many options for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I'll take a closer look at leveraging the Mocha test reporter

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.

2 participants