You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: JShellAPI/README.MD
+13-96
Original file line number
Diff line number
Diff line change
@@ -87,111 +87,28 @@ The following startup scripts id can be used :
87
87
- EMPTY : no startup script
88
88
- CUSTOM_DEFAULT : contains basic imports, print methods and range method
89
89
## Configuration
90
+
91
+
### Properties
90
92
Properties can be defined in resources/application.properties
91
-
### jshellapi.regularSessionTimeoutSeconds
93
+
####jshellapi.regularSessionTimeoutSeconds
92
94
The timeout of a regular session, in seconds, see [Session timeout](#Session-timeout).
93
-
### jshellapi.oneTimeSessionTimeoutSeconds
95
+
####jshellapi.oneTimeSessionTimeoutSeconds
94
96
The timeout of a one-time session, in seconds, see [One-time session timeout](#One-time-session-timeout).
95
-
### jshellapi.evalTimeoutSeconds
97
+
####jshellapi.evalTimeoutSeconds
96
98
The timeout of an evaluation, in seconds, see [Eval timeout](#Eval-timeout)
97
-
### jshellapi.maxAliveSessions
99
+
####jshellapi.maxAliveSessions
98
100
The maximum number of alive sessions, see [Errors](#Errors)
99
-
### jshellapi.dockerMaxRamMegaBytes
101
+
####jshellapi.dockerMaxRamMegaBytes
100
102
The maximum ram allocated per container, in megabytes.
101
-
### jshellapi.dockerCPUsUsage
103
+
####jshellapi.dockerCPUsUsage
102
104
The cpu configuration of each container, see [--cpus option of docker](https://docs.docker.com/config/containers/resource_constraints/#cpu).
103
-
### jshellapi.schedulerSessionKillScanRate
105
+
####jshellapi.schedulerSessionKillScanRate
104
106
The rate at which the session killer will check and delete session, in seconds, see [Session timeout](#Session-timeout).
105
107
106
-
## Testing
107
-
108
-
> The work on testing was made in collaboration with [Alathreon](https://github.com/Alathreon) and [Wazei](https://github.com/tj-wazei). I'd like thank both of them for their trust. - FirasRG
109
-
110
-
This section outlines the work done to set up the first integration test that evaluates Java code by running it in a [Docker](https://www.docker.com/get-started/) container. The test ensures that the [Eval endpoint](#eval) can execute code within the containerized environment of [**JShellWrapper**](../JShellWrapper).
The [@SpringBootTest](https://docs.spring.io/spring-boot/api/java/org/springframework/boot/test/context/SpringBootTest.html) and [@ContextConfiguration](https://docs.spring.io/spring-framework/reference/testing/annotations/integration-spring/annotation-contextconfiguration.html) annotations are needed to prepare the app to tests, like in a real scenario.
145
-
146
-
NOTE: _Test classes must be located under `/src/test/java/{org.togetherjava.jshellapi}`._
147
-
148
-
- The test uses [WebTestClient](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/reactive/server/WebTestClient.html) to make HTTP calls to the target endpoint.
149
-
- Multiple API calls are made within the test method, so a utility instance method was created for reuse.
150
-
- The test ensures that code is correctly evaluated inside the **JShellWrapper** container.
108
+
### Testing
109
+
**JShellWrapper** Docker image lifecycle is handled during tests.
151
110
152
-
### 2. Gradle Configuration for Tests
111
+
The image name is injected from the root [build.gradle](../build.gradle) file, to this project's [build.gradle](build.gradle) file and also to [application.yaml](src/main/resources/application.yaml).
153
112
154
-
The `build.gradle` of this project has been updated to handle **JShellWrapper** Docker image lifecycle during tests.
155
-
156
-
-**JShellWrapper Image Name**: the image name is injected from the root [build.gradle](../build.gradle) file, to this project's [build.gradle](build.gradle) file and also to [application.yaml](src/main/resources/application.yaml)!
157
-
-**JShellWrapper Docker Image**: The image is built before the tests run.
113
+
- JShellWrapper Docker Image is built before the tests run.
158
114
-**Container & Cleanup**: After the tests finish, the container and image are removed to ensure a clean environment.
- The `logback-classic` has been excluded because of an issue encountered when running tests. The issue is typically about a conflict between some dependencies (This solution has been brought based on [a _good_ answer on Stackoverflow](https://stackoverflow.com/a/42641450/10000150))
197
-
- The `spring-boot-starter-webflux` was needed in order to be able to use **WebTestClient**.
0 commit comments