Skip to content

Commit 8bb67a0

Browse files
committed
updated dockerfile to include javac for book_server_api java code testing
1 parent d454d33 commit 8bb67a0

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

bases/rsptx/book_server_api/routers/personalized_parsons/generate_parsons_blocks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ def generate_partial_Parsons(
204204
blocks = fixed_lines + unchanged_lines + matched_fixed_lines
205205
for fixed_line_key in distractor_tuple_dict.keys():
206206
blocks = [
207-
(line[0], line[1], line[2].rstrip() + " #matched-fixed\n")
208-
if line[2].strip() == fixed_line_key[2].strip()
209-
else (line[0], line[1], line[2])
207+
(
208+
(line[0], line[1], line[2].rstrip() + " #matched-fixed\n")
209+
if line[2].strip() == fixed_line_key[2].strip()
210+
else (line[0], line[1], line[2])
211+
)
210212
for line in blocks
211213
]
212214
fixed_line_code = fixed_line_key[2]

bases/rsptx/interactives/runestone/activecode/js/activecode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ export class ActiveCode extends RunestoneBase {
549549

550550
// This function is used to convert JUnit test code to a format suitable for backend processing.
551551
function junitToBackend(junitCode) {
552+
console.log("Original JUnit code:", junitCode);
552553
// Extract only the TestHelper class - match from the first line to the first empty line after it
553554
const helperMatch = junitCode.match(/class TestHelper[\s\S]*?\n\s*\n/);
554555
const helperCode = helperMatch ? helperMatch[0] : "";

projects/book_server/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ RUN rm /usr/src/app/$wheel
3838
FROM python:3.13-slim
3939
WORKDIR /usr/src/app
4040

41+
# Install Java JDK (so `javac` is available)
42+
RUN apt-get update && apt-get install -y --no-install-recommends \
43+
default-jdk ca-certificates \
44+
&& rm -rf /var/lib/apt/lists/*
45+
46+
# Set Java environment variables
47+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
48+
ENV PATH="$JAVA_HOME/bin:$PATH"
49+
4150
COPY --from=builder /usr/local /usr/local
4251

4352
CMD ["uvicorn", "rsptx.book_server_api.main:app", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)