Skip to content

Commit 3e1602c

Browse files
Add/update unit tests (#594)
1 parent 837fc61 commit 3e1602c

File tree

74 files changed

+1226
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1226
-49
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ARG SAGEMAKER_DISTRIBUTION_IMAGE
2+
FROM $SAGEMAKER_DISTRIBUTION_IMAGE
3+
4+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
5+
6+
RUN sudo apt-get update && \
7+
sudo apt-get install -y git && \
8+
git clone --recursive https://github.com/fastapi/fastapi
9+
10+
WORKDIR "fastapi"
11+
12+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_fastapi_tests.sh .
13+
14+
RUN chmod +x run_fastapi_tests.sh
15+
16+
CMD ["./run_fastapi_tests.sh"]
17+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ARG SAGEMAKER_DISTRIBUTION_IMAGE
2+
FROM $SAGEMAKER_DISTRIBUTION_IMAGE
3+
4+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
5+
6+
ENV OPENBLAS_NUM_THREADS=1
7+
8+
RUN sudo apt-get update && \
9+
sudo apt-get install -y git
10+
11+
RUN git clone https://github.com/jupyter-widgets/ipywidgets.git
12+
13+
WORKDIR "ipywidgets"
14+
15+
RUN pip install jupyter nbconvert
16+
17+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_ipywidgets_tests.sh ./
18+
RUN chmod +x run_ipywidgets_tests.sh
19+
20+
CMD ["./run_ipywidgets_tests.sh"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ARG SAGEMAKER_DISTRIBUTION_IMAGE
2+
FROM $SAGEMAKER_DISTRIBUTION_IMAGE
3+
4+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
5+
6+
ENV OPENBLAS_NUM_THREADS=1
7+
8+
RUN micromamba install -y -c conda-forge jinja2
9+
10+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_jinja2_tests.sh ./
11+
12+
RUN chmod +x run_jinja2_tests.sh
13+
14+
CMD ["./run_jinja2_tests.sh"]

test/test_artifacts/v2/jupyter-collaboration.test.Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@ FROM $SAGEMAKER_DISTRIBUTION_IMAGE
33

44
ARG MAMBA_DOCKERFILE_ACTIVATE=1
55

6-
CMD ["python", "-c", "import jupyter_collaboration; import jupyter_server_fileid; from jupyter_ydoc import YBlob; yblob = YBlob(); assert yblob.get() == b''; yblob.set(b'012'); assert yblob.get() == b'012'"]
6+
RUN sudo apt-get update && \
7+
sudo apt-get install -y git
8+
9+
RUN git clone --recursive https://github.com/jupyterlab/jupyter-collaboration.git
10+
11+
WORKDIR "jupyter-collaboration"
12+
13+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_jupyter_collaboration_tests.sh .
14+
15+
RUN chmod +x run_jupyter_collaboration_tests.sh
16+
17+
CMD ["./run_jupyter_collaboration_tests.sh"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ARG SAGEMAKER_DISTRIBUTION_IMAGE
2+
FROM $SAGEMAKER_DISTRIBUTION_IMAGE
3+
4+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
5+
6+
RUN sudo apt-get update && \
7+
sudo apt-get install -y git && \
8+
git clone --recursive https://github.com/jupyter-server/jupyter-scheduler
9+
10+
WORKDIR "jupyter-scheduler"
11+
12+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_jupyter_scheduler_tests.sh .
13+
14+
RUN chmod +x run_jupyter_scheduler_tests.sh
15+
16+
CMD ["./run_jupyter_scheduler_tests.sh"]
17+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARG SAGEMAKER_DISTRIBUTION_IMAGE
2+
FROM $SAGEMAKER_DISTRIBUTION_IMAGE
3+
4+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
5+
6+
RUN sudo apt-get update && \
7+
sudo apt-get install -y git && \
8+
git clone --recursive https://github.com/jupyterhub/jupyter-server-proxy.git
9+
10+
WORKDIR "jupyter-server-proxy"
11+
12+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_jupyter_server_proxy_tests.sh .
13+
14+
RUN chmod +x run_jupyter_server_proxy_tests.sh
15+
16+
CMD ["./run_jupyter_server_proxy_tests.sh"]

test/test_artifacts/v2/jupyterlab-git.test.Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@ FROM $SAGEMAKER_DISTRIBUTION_IMAGE
33

44
ARG MAMBA_DOCKERFILE_ACTIVATE=1
55

6-
CMD ["python", "-c", "import jupyterlab_git"]
6+
RUN sudo apt-get update && \
7+
sudo apt-get install -y git
8+
9+
RUN git clone --recursive https://github.com/jupyterlab/jupyterlab-git
10+
11+
WORKDIR "jupyterlab-git"
12+
13+
RUN micromamba install --freeze-installed -y -c conda-forge pytest
14+
15+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_jupyterlab_git_tests.sh .
16+
RUN chmod +x run_jupyterlab_git_tests.sh
17+
18+
CMD ["./run_jupyterlab_git_tests.sh"]

test/test_artifacts/v2/jupyterlab-lsp.test.Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ FROM $SAGEMAKER_DISTRIBUTION_IMAGE
33

44
ARG MAMBA_DOCKERFILE_ACTIVATE=1
55

6-
CMD ["python", "-c", "import jupyter_lsp"]
7-
CMD ["python", "-c", "import jupyterlab_lsp"]
6+
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_jupyterlab_lsp_tests.sh ./
7+
RUN chmod +x run_jupyterlab_lsp_tests.sh
8+
9+
CMD ["./run_jupyterlab_lsp_tests.sh"]
10+

test/test_artifacts/v2/langchain-aws.test.Dockerfile

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
ARG SAGEMAKER_DISTRIBUTION_IMAGE
2+
FROM $SAGEMAKER_DISTRIBUTION_IMAGE
3+
4+
ARG MAMBA_DOCKERFILE_ACTIVATE=1
5+
6+
ENV OPENBLAS_NUM_THREADS=1
7+
8+
RUN micromamba install -y -c conda-forge pytest
9+
10+
# Create the test script
11+
RUN echo '#!/bin/bash' > /home/sagemaker-user/run_langchain_tests.sh && \
12+
echo 'set -e' >> /home/sagemaker-user/run_langchain_tests.sh && \
13+
echo 'echo "Langchain version: $(python -c "import langchain; print(langchain.__version__)")"' >> /home/sagemaker-user/run_langchain_tests.sh && \
14+
echo 'langchain_path=$(python -c "import langchain; import os; print(os.path.dirname(langchain.__file__))")' >> /home/sagemaker-user/run_langchain_tests.sh && \
15+
echo 'test_path="${langchain_path}/tests/unit_tests"' >> /home/sagemaker-user/run_langchain_tests.sh && \
16+
echo 'if [ -d "$test_path" ]; then' >> /home/sagemaker-user/run_langchain_tests.sh && \
17+
echo ' pytest "$test_path" -v' >> /home/sagemaker-user/run_langchain_tests.sh && \
18+
echo 'else' >> /home/sagemaker-user/run_langchain_tests.sh && \
19+
echo ' echo "Unit tests directory not found at $test_path"' >> /home/sagemaker-user/run_langchain_tests.sh && \
20+
echo ' echo "Available files in langchain directory:"' >> /home/sagemaker-user/run_langchain_tests.sh && \
21+
echo ' find "$langchain_path" -name "*.py"' >> /home/sagemaker-user/run_langchain_tests.sh && \
22+
echo 'fi' >> /home/sagemaker-user/run_langchain_tests.sh
23+
24+
RUN chmod +x /home/sagemaker-user/run_langchain_tests.sh
25+
26+
WORKDIR /home/sagemaker-user
27+
28+
CMD ["./run_langchain_tests.sh"]

0 commit comments

Comments
 (0)