Skip to content
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

Fix flakey test. #16

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ test("e2e catalog, cortex, and sync chat", { timeout: 60000 }, async () => {

const nextPage = await chatList.nextPage();
expect(nextPage.chats.length).toBe(1);
expect(nextPage.chats[0].id).not.toBe(chat.id);
expect(nextPage.chats[0].id).not.toBe(chatList.chats[0].id);

// delete
await catalog.delete();
Expand Down
37 changes: 0 additions & 37 deletions content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,40 +271,3 @@ test("test streaming content", { timeout: 180000 }, async () => {

await catalog.delete();
});

test("e2e content without any catalogs", { timeout: 180000 }, async () => {
testClient.configureOrg({
companyName: "Cortex Click",
companyInfo:
"Cortex Click provides an AI platform for go-to-market. Cortex click allows you to index your enterprise knowledge base, and create agents called Cortexes that automate sales and marketing processes like SEO, content writing, RFP generation, customer support, sales document genearation such as security questionairres and more.",
personality: [
"friendly and helpful",
"expert sales and marketing professional",
"experienced software developer",
],
rules: [
"never say anything disparaging about AI or LLMs",
"do not offer discounts",
],
});

const cortex = await testClient.configureCortex(
`cortex-${Math.floor(Math.random() * 10000)}`,
{
friendlyName: "Cortex AI",
instructions: ["answer questions about the cortex click AI GTM platform"],
public: true,
},
);

// create content
const title = "Overview of the Cortex Click AI GTM Platform";
const prompt =
"Write a blog post about the Cortex Click AI GTM Platform. Elaborate on scenarios, customers, and appropriate verticals. Make sure to mention the impact that AI can have on sales and marketing teams.";
const content = await cortex.generateContent({ title, prompt });

expect(content.content.length).toBeGreaterThan(1);
expect(content.title).toBe(title);
expect(content.version).toBe(0);
expect(content.commands.length).toBe(1);
});