Skip to content

Commit

Permalink
test: change chef bot repo path (#11218)
Browse files Browse the repository at this point in the history
* test: change chef bot repo path
  • Loading branch information
ayachensiyuan authored Mar 28, 2024
1 parent 9202795 commit 4cb5c08
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs:
path: packages/tests/src/e2e/resource

- name: Download samples(rc)
if: github.event_name == 'workflow_dispatch' && startsWith(matrix.cases, './samples/') && contains(matrix.cases, 'ProactiveMessage') == false && contains(matrix.cases, 'SignatureOutlook') == false
if: github.event_name == 'workflow_dispatch' && startsWith(matrix.cases, './samples/') && contains(matrix.cases, 'ProactiveMessage') == false && contains(matrix.cases, 'SignatureOutlook') == false && contains(matrix.cases, 'ChefBot') == false
uses: actions/checkout@v3
with:
repository: OfficeDev/TeamsFx-Samples
Expand All @@ -235,6 +235,14 @@ jobs:
ref: main
path: packages/tests/src/e2e/resource

- name: Download samples from ai repo
if: startsWith(matrix.cases, './samples/') && contains(matrix.cases, 'ChefBot')
uses: actions/checkout@v3
with:
repository: microsoft/teams-ai
ref: main
path: packages/tests/src/e2e/resource

- name: run test
working-directory: packages/tests/src/e2e
run: |
Expand Down
24 changes: 18 additions & 6 deletions packages/tests/src/e2e/samples/ProvisionChefBot.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,37 @@

import { TemplateProjectFolder } from "../../utils/constants";
import { CaseFactory } from "./sampleCaseFactory";
import { Executor } from "../../utils/executor";
import * as fs from "fs-extra";
import * as path from "path";
import { expect } from "chai";

class ChefBotTestCase extends CaseFactory {
public override async onCreate(
appName: string,
testFolder: string,
sampleName: TemplateProjectFolder
): Promise<void> {
await Executor.openTemplateProject(
appName,
testFolder,
sampleName,
undefined,
"js/samples"
);
}
public override async onAfterCreate(projectPath: string): Promise<void> {
expect(fs.pathExistsSync(path.resolve(projectPath, "infra"))).to.be.true;

const userFile = path.resolve(projectPath, "env", `.env.dev.user`);
const KEY = "SECRET_OPENAI_API_KEY=MY_OPENAI_API_KEY";
const userFile = path.resolve(projectPath, ".env");
const KEY = "OPENAI_KEY=MY_OPENAI_API_KEY";
fs.writeFileSync(userFile, KEY);
console.log(`add key ${KEY} to .env.dev.user file`);
console.log(`add key ${KEY} to .env file`);
}
}

new ChefBotTestCase(
TemplateProjectFolder.ChefBot,
25227103,
"ning.tang@microsoft.com",
[],
{ skipValidate: true }
"ning.tang@microsoft.com"
).test();
2 changes: 1 addition & 1 deletion packages/tests/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export enum TemplateProjectFolder {
OutlookTab = "hello-world-teams-tab-and-outlook-add-in",
AssistDashboard = "developer-assist-dashboard",
DiceRoller = "live-share-dice-roller",
ChefBot = "teams-chef-bot",
ChefBot = "04.ai.a.teamsChefBot",
GraphConnectorBot = "graph-connector-bot",
SpfxProductivity = "spfx-productivity-dashboard",
RetailDashboard = "react-retail-dashboard",
Expand Down

0 comments on commit 4cb5c08

Please sign in to comment.