File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,25 @@ interface TestSetup {
3333 stagingEnvironmentId : string ;
3434}
3535
36+ function readEnvironment ( ) {
37+ if ( ! [ process . env . HUMANLOOP_API_KEY , process . env . OPENAI_API_KEY ] . every ( Boolean ) ) {
38+ // Testing locally not in CI, running dotenv.config() would override the secrets set for GitHub Action
39+ dotenv . config ( { } ) ;
40+ }
41+ if ( ! process . env . HUMANLOOP_API_KEY ) {
42+ throw new Error ( "HUMANLOOP_API_KEY is not set" ) ;
43+ }
44+ if ( ! process . env . OPENAI_API_KEY ) {
45+ throw new Error ( "OPENAI_API_KEY is not set for integration tests" ) ;
46+ }
47+ }
48+
3649describe ( "Evals" , ( ) => {
3750 let humanloopClient : HumanloopClient ;
3851 let openaiApiKey : string ;
3952
4053 beforeAll ( async ( ) => {
41- dotenv . config ( ) ;
54+ readEnvironment ( ) ;
4255 if ( ! process . env . HUMANLOOP_API_KEY ) {
4356 throw new Error ( "HUMANLOOP_API_KEY is not set" ) ;
4457 }
You can’t perform that action at this time.
0 commit comments