File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public static IResourceBuilder<SqliteResource> WithSqliteWeb(this IResourceBuild
7676 . WithImage ( SqliteContainerImageTags . SqliteWebImage , SqliteContainerImageTags . SqliteWebTag )
7777 . WithImageRegistry ( SqliteContainerImageTags . SqliteWebRegistry )
7878 . WithHttpEndpoint ( targetPort : 8080 , name : "http" )
79- . WithEnvironment ( context => context . EnvironmentVariables . Add ( "SQLITE_DATABASE" , builder . Resource . DatabaseFileName ) )
79+ . WithArgs ( builder . Resource . DatabaseFileName )
8080 . WithBindMount ( builder . Resource . DatabasePath , "/data" )
8181 . WaitFor ( builder )
8282 . WithHttpHealthCheck ( "/" )
Original file line number Diff line number Diff line change @@ -120,10 +120,10 @@ public async Task SqliteWebResourceConfigured()
120120 Assert . Equal ( SqliteContainerImageTags . SqliteWebTag , imageAnnotation . Tag ) ;
121121 Assert . Equal ( SqliteContainerImageTags . SqliteWebRegistry , imageAnnotation . Registry ) ;
122122
123- var env = await sqliteWeb . GetEnvironmentVariableValuesAsync ( ) ;
124- var envVar = Assert . Single ( env ) ;
125- Assert . Equal ( "SQLITE_DATABASE" , envVar . Key ) ;
126- Assert . Equal ( sqlite . Resource . DatabaseFileName , envVar . Value ) ;
123+ Assert . True ( sqliteWeb . TryGetLastAnnotation ( out CommandLineArgsCallbackAnnotation ? argsAnnotation ) ) ;
124+ CommandLineArgsCallbackContext argsContext = new ( [ ] ) ;
125+ await argsAnnotation . Callback ( argsContext ) ;
126+ Assert . Contains ( sqlite . Resource . DatabaseFileName , argsContext . Args ) ;
127127
128128 Assert . True ( sqliteWeb . TryGetAnnotationsOfType < ContainerMountAnnotation > ( out var bindMountAnnotations ) ) ;
129129 var bindMountAnnotation = Assert . Single ( bindMountAnnotations ) ;
You can’t perform that action at this time.
0 commit comments