diff --git a/.github/workflows/unit-tests-docker.yml b/.github/workflows/unit-tests-docker.yml index 3158532..7adeafd 100644 --- a/.github/workflows/unit-tests-docker.yml +++ b/.github/workflows/unit-tests-docker.yml @@ -1,7 +1,5 @@ name: Unit Tests on: - push: - branches: [ "master", "develop"] pull_request: branches: [ "master", "develop"] @@ -22,7 +20,7 @@ jobs: - name: Extract coverage run: | docker run --rm -v $(pwd):/host oprl sh -c " - pytest --cov=oprl --cov-report=xml && + pytest tests/functional --cov=oprl --cov-report=xml && cp coverage.xml /host/ " diff --git a/Dockerfile b/Dockerfile index 029e0f1..688df96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,13 @@ WORKDIR /app RUN pip install --no-cache-dir --upgrade pip +# Install SafetyGymansium from external lib +RUN wget https://github.com/PKU-Alignment/safety-gymnasium/archive/refs/heads/main.zip && \ + unzip main.zip && \ + cd safety-gymnasium-main && \ + pip install . && \ + cd .. + COPY . . RUN pip install --no-cache-dir . && pip install pytest pytest-cov diff --git a/tests/functional/test_env.py b/tests/functional/test_env.py index 2cf2ec2..1facf87 100644 --- a/tests/functional/test_env.py +++ b/tests/functional/test_env.py @@ -39,7 +39,7 @@ ] -env_names: list[str] = dm_control_envs # + safety_envs +env_names: list[str] = dm_control_envs + safety_envs @pytest.mark.parametrize("env_name", env_names)