Skip to content

Commit

Permalink
Dockerfile, tests: fix typo, add backstop (#16309)
Browse files Browse the repository at this point in the history
* Dockerfile, tests: fix typo, add backstop

Signed-off-by: William Woodruff <william@trailofbits.com>

* formatting, comment

Signed-off-by: William Woodruff <william@trailofbits.com>

---------

Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw authored Jul 19, 2024
1 parent 6c1ffd1 commit acd94b5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
# to keep these.
RUN mkdir -p /tmp/share /tmp/cache
ENV XDG_DATA_HOME /tmp/share
ENV XDG_CACHE_COME /tmp/cache
ENV XDG_CACHE_HOME /tmp/cache

# Copy the directory into the container, this is done last so that changes to
# Warehouse itself require the least amount of layers being invalidated from
Expand Down
22 changes: 22 additions & 0 deletions tests/functional/test_environment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import platformdirs


def test_xdg_environment():
# Backstop checks for Warehouse's (Dockerfile-configured) environment.
user_data = platformdirs.user_data_dir()
user_cache = platformdirs.user_cache_dir()

assert user_data == "/tmp/share"
assert user_cache == "/tmp/cache"

0 comments on commit acd94b5

Please sign in to comment.