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
-93
Original file line number
Diff line number
Diff line change
@@ -102,96 +102,3 @@ The maximum ram allocated per container, in megabytes.
102
102
The cpu configuration of each container, see [--cpus option of docker](https://docs.docker.com/config/containers/resource_constraints/#cpu).
103
103
### jshellapi.schedulerSessionKillScanRate
104
104
The rate at which the session killer will check and delete session, in seconds, see [Session timeout](#Session-timeout).
105
-
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.
151
-
152
-
### 2. Gradle Configuration for Tests
153
-
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.
158
-
-**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**.
Copy file name to clipboardExpand all lines: README.md
+8
Original file line number
Diff line number
Diff line change
@@ -47,3 +47,11 @@ JShellAPI is a REST API, and whenever some code is received, it will create a se
47
47
48
48
## How to use JShellApi ?
49
49
See [JShellAPI README](JShellAPI/README.MD)
50
+
51
+
## Testing
52
+
**JShellWrapper** Docker image lifecycle is handled during tests.
53
+
54
+
The image name is injected from the root [build.gradle](./build.gradle) file, to JShellAPI project's [build.gradle](./JShellAPI/build.gradle) file and also to its [application.yaml](./JShellAPI/src/main/resources/application.yaml).
55
+
56
+
- JShellWrapper Docker Image is built before the tests run.
57
+
-**Container & Cleanup**: After the tests finish, the container and image are removed to ensure a clean environment.
0 commit comments