Skip to content

Commit cbd5a85

Browse files
committed
fix: use default index name
1 parent caa0c77 commit cbd5a85

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

e2e/basic.spec.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable turbo/no-undeclared-env-vars */
22
import { expect, test } from "@playwright/test";
33
import { ChildProcess } from "child_process";
4-
import { randomUUID } from "crypto";
54
import fs from "fs";
65
import path from "path";
76
import type {
@@ -26,7 +25,7 @@ const templatePostInstallActions: TemplatePostInstallAction[] = [
2625
];
2726

2827
const llamaCloudProjectName = "create-llama";
29-
const llamaCloudIndexName = randomUUID();
28+
const llamaCloudIndexName = "e2e-test";
3029

3130
for (const templateType of templateTypes) {
3231
for (const templateFramework of templateFrameworks) {

e2e/utils.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ export async function runCreateLlama(
7575
llamaCloudProjectName: string,
7676
llamaCloudIndexName: string,
7777
): Promise<CreateLlamaResult> {
78+
if (!process.env.OPENAI_API_KEY || !process.env.LLAMA_CLOUD_API_KEY) {
79+
throw new Error(
80+
"Setting the OPENAI_API_KEY and LLAMA_CLOUD_API_KEY is mandatory to run tests",
81+
);
82+
}
7883
const name = [
7984
templateType,
8085
templateFramework,
@@ -94,8 +99,8 @@ export async function runCreateLlama(
9499
templateUI,
95100
"--vector-db",
96101
vectorDb,
97-
process.env.OPENAI_API_KEY ? "--open-ai-key" : "",
98-
process.env.OPENAI_API_KEY || "",
102+
"--open-ai-key",
103+
process.env.OPENAI_API_KEY,
99104
appType,
100105
"--use-pnpm",
101106
"--port",
@@ -109,8 +114,8 @@ export async function runCreateLlama(
109114
"--no-llama-parse",
110115
"--observability",
111116
"none",
112-
process.env.LLAMA_CLOUD_API_KEY ? "--llama-cloud-key" : "",
113-
process.env.LLAMA_CLOUD_API_KEY || "",
117+
"--llama-cloud-key",
118+
process.env.LLAMA_CLOUD_API_KEY,
114119
].join(" ");
115120
console.log(`running command '${command}' in ${cwd}`);
116121
const appProcess = exec(command, {

0 commit comments

Comments
 (0)