@@ -44,21 +44,54 @@ test("config keeps explicit path override precedence", () => {
4444 ) ;
4545} ) ;
4646
47- test ( "dev environment file does not include a store override " , ( ) => {
47+ test ( "generated environment files document defaults and S3 settings " , ( ) => {
4848 const originalCwd = process . cwd ( ) ;
4949 const cwd = mkdtempSync ( join ( tmpdir ( ) , "agentpond-config-" ) ) ;
5050 try {
5151 process . chdir ( cwd ) ;
5252 const dev = initAgentPondEnvironment ( "dev" ) ;
5353 const production = initAgentPondEnvironment ( "production" ) ;
54+ const devFile = readFileSync ( dev . envFilePath , "utf8" ) ;
55+ const productionFile = readFileSync ( production . envFilePath , "utf8" ) ;
5456
55- assert . doesNotMatch (
56- readFileSync ( dev . envFilePath , "utf8" ) ,
57- / A G E N T P O N D _ S T O R E = / ,
57+ assert . equal ( devFile , "" ) ;
58+ assert . doesNotMatch ( devFile , / A G E N T P O N D _ P R O J E C T _ I D = / ) ;
59+ assert . doesNotMatch ( devFile , / A G E N T P O N D _ S T O R E = / ) ;
60+ assert . doesNotMatch ( devFile , / A G E N T P O N D _ S 3 _ B U C K E T = / ) ;
61+ assert . doesNotMatch ( devFile , / L A N G F U S E _ B A S E _ U R L = / ) ;
62+ assert . doesNotMatch ( devFile , / L A N G F U S E _ P U B L I C _ K E Y = / ) ;
63+ assert . doesNotMatch ( devFile , / L A N G F U S E _ S E C R E T _ K E Y = / ) ;
64+
65+ assert . match ( productionFile , / # S t o r a g e b a c k e n d / ) ;
66+ assert . match ( productionFile , / L A N G F U S E _ B A S E _ U R L = h t t p : \/ \/ l o c a l h o s t : 4 3 1 8 / ) ;
67+ assert . match ( productionFile , / A G E N T P O N D _ S T O R E = s 3 / ) ;
68+ assert . match ( productionFile , / # S 3 b u c k e t / ) ;
69+ assert . match ( productionFile , / A G E N T P O N D _ S 3 _ B U C K E T = a g e n t p o n d / ) ;
70+ assert . match ( productionFile , / A G E N T P O N D _ S 3 _ P R E F I X = / ) ;
71+ assert . match (
72+ productionFile ,
73+ / L o c a l M i n I O e n d p o i n t f r o m d o c k e r - c o m p o s e \. y m l / ,
5874 ) ;
5975 assert . match (
60- readFileSync ( production . envFilePath , "utf8" ) ,
61- / A G E N T P O N D _ S T O R E = s 3 / ,
76+ productionFile ,
77+ / A G E N T P O N D _ S 3 _ E N D P O I N T = h t t p : \/ \/ l o c a l h o s t : 9 0 0 0 / ,
78+ ) ;
79+ assert . match ( productionFile , / A G E N T P O N D _ S 3 _ R E G I O N = u s - e a s t - 1 / ) ;
80+ assert . match ( productionFile , / A G E N T P O N D _ S 3 _ A C C E S S _ K E Y _ I D = m i n i o / ) ;
81+ assert . match ( productionFile , / A G E N T P O N D _ S 3 _ S E C R E T _ A C C E S S _ K E Y = m i n i o 1 2 3 / ) ;
82+ assert . match ( productionFile , / U s e t r u e f o r M i n I O / ) ;
83+ assert . match ( productionFile , / A G E N T P O N D _ S 3 _ F O R C E _ P A T H _ S T Y L E = t r u e / ) ;
84+ assert . equal (
85+ configFromEnv ( { envName : "production" } ) . s3 . endpoint ,
86+ "http://localhost:9000" ,
87+ ) ;
88+ assert . equal (
89+ configFromEnv ( { envName : "production" } ) . s3 . accessKeyId ,
90+ "minio" ,
91+ ) ;
92+ assert . equal (
93+ configFromEnv ( { envName : "production" } ) . s3 . secretAccessKey ,
94+ "minio123" ,
6295 ) ;
6396 } finally {
6497 process . chdir ( originalCwd ) ;
0 commit comments