Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/e2e/pythonFix.stest.ts
13388 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as path from 'path';
7
import { ssuite, stest } from '../base/stest';
8
import { pythonFixEvaluators } from './evaluators/pythonFix';
9
import { Scenario, fetchConversationScenarios } from './scenarioLoader';
10
import { generateScenarioTestRunner } from './scenarioTest';
11
12
(function () {
13
ssuite({ title: 'fix', subtitle: 'python', location: 'panel' }, (inputPath) => {
14
15
const scenarioFolder = inputPath ?? path.join(__dirname, '..', 'test/scenarios/test-scenario-fix-python');
16
const scenarios: Scenario[] = fetchConversationScenarios(scenarioFolder);
17
18
// Dynamically create a test case per each entry in the scenarios array
19
for (let i = 0; i < scenarios.length; i++) {
20
const name = scenarios[i][0].name;
21
const label = name.replace('case', 'Case #').replace('.conversation.json', '');
22
23
stest({ description: label, language: 'python' },
24
generateScenarioTestRunner(
25
scenarios[i],
26
pythonFixEvaluators[scenarios[i][0].name]
27
));
28
}
29
});
30
})();
31
32