File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable turbo/no-undeclared-env-vars */
2
2
import { expect , test } from "@playwright/test" ;
3
3
import { ChildProcess } from "child_process" ;
4
- import { randomUUID } from "crypto" ;
5
4
import fs from "fs" ;
6
5
import path from "path" ;
7
6
import type {
@@ -26,7 +25,7 @@ const templatePostInstallActions: TemplatePostInstallAction[] = [
26
25
] ;
27
26
28
27
const llamaCloudProjectName = "create-llama" ;
29
- const llamaCloudIndexName = randomUUID ( ) ;
28
+ const llamaCloudIndexName = "e2e-test" ;
30
29
31
30
for ( const templateType of templateTypes ) {
32
31
for ( const templateFramework of templateFrameworks ) {
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ export async function runCreateLlama(
75
75
llamaCloudProjectName : string ,
76
76
llamaCloudIndexName : string ,
77
77
) : 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
+ }
78
83
const name = [
79
84
templateType ,
80
85
templateFramework ,
@@ -94,8 +99,8 @@ export async function runCreateLlama(
94
99
templateUI ,
95
100
"--vector-db" ,
96
101
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 ,
99
104
appType ,
100
105
"--use-pnpm" ,
101
106
"--port" ,
@@ -109,8 +114,8 @@ export async function runCreateLlama(
109
114
"--no-llama-parse" ,
110
115
"--observability" ,
111
116
"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 ,
114
119
] . join ( " " ) ;
115
120
console . log ( `running command '${ command } ' in ${ cwd } ` ) ;
116
121
const appProcess = exec ( command , {
You can’t perform that action at this time.
0 commit comments