Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:22-bookworm

ARG DEBIAN_FRONTEND=noninteractive

ENV SHELL=/bin/bash

RUN apt-get update && \
apt-get install -y sudo ca-certificates curl gnupg tar wget python3 python3-pip python3-venv python-is-python3 && \
curl -fsSL https://build.openmodelica.org/apt/openmodelica.asc | gpg --dearmor -o /usr/share/keyrings/openmodelica-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/openmodelica-keyring.gpg] https://build.openmodelica.org/apt bookworm stable" > /etc/apt/sources.list.d/openmodelica.list && \
apt-get update && \
apt-get install -y --no-install-recommends omc && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

USER node
RUN printf 'success:=installPackage(Modelica, version = "4.0.0", exactMatch = true);\nif not success then exit(1); end if;\n' > /tmp/install.mos && \
omc /tmp/install.mos && \
rm -rf /tmp/install.mos
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
// Dockerfile
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile"
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
8 changes: 6 additions & 2 deletions __tests__/installdeps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ describe('installdeps.ts', () => {
fs.writeFileSync(requirementsFile, requirements)
const { stdout, stderr } = await installPythonDeps(requirementsFile)

expect(stderr).toBe('')
// stderr should be empty or start with deprecation warning "DEPRECATION: ompython"
expect(stderr === '' || stderr.startsWith('DEPRECATION: ompython')).toBe(
true
)

expect(stdout).toContain('datetime')
expect(stdout).toContain('matplotlib')
expect(stdout).toContain('monotonic')
Expand All @@ -40,6 +44,6 @@ describe('installdeps.ts', () => {
expect(stdout).toContain('simplejson')
expect(stdout).toContain('psutil')
},
2 * 60000 /* 2 minutes */
5 * 60000 /* 5 minutes */
)
})
Loading