Skip to content

Commit

Permalink
Merge branch 'dev' into HMS-2195-Fix-cross-spawn-regular-expression-d…
Browse files Browse the repository at this point in the history
…enial-of-service
  • Loading branch information
rv0lt authored Dec 12, 2024
2 parents 4f0a0a0 + 7019097 commit d4290b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Dockerfiles/backend.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ ENV PYTHONPATH /code
###################
FROM base as test
RUN pip3 install -r /code/tests/requirements-test.txt
RUN apk add mariadb-client

# The version of mariadb-client should match the version of the mariadb server
# Because of how alpine works, this is how to pin a version. However, it can break if this branch is removed from alpine
# https://superuser.com/questions/1055060/how-to-install-a-specific-package-version-in-alpine
# https://pkgs.alpinelinux.org/packages?name=mariadb-client&branch=v3.19&repo=&arch=x86_64&origin=&flagged=&maintainer=
RUN apk add mariadb-client=~10.11 --repository https://dl-cdn.alpinelinux.org/alpine/v3.19/main/

# Switch to the user
USER $USERNAME
Expand Down
4 changes: 3 additions & 1 deletion SPRINTLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,6 @@ _Nothing merged during this sprint_
- Change the error raised upon attempt to download data after a password reset to an AuthenticationError to avoid getting an alert ([#1571](https://github.com/ScilifelabDataCentre/dds_web/pull/1571))
- Filter out the MaintenanceModeException from the logs ([#1573](https://github.com/ScilifelabDataCentre/dds_web/pull/1573))
- Bugfix: Quick and dirty change to prevent `dds ls --tree` from failing systematically ([#1575](https://github.com/ScilifelabDataCentre/dds_web/pull/1575)
- run npm audit fix to solve node cve's ([#1577](https://github.com/ScilifelabDataCentre/dds_web/pull/1577)
- Run npm audit fix to solve node cve's ([#1577](https://github.com/ScilifelabDataCentre/dds_web/pull/1577)
- Update backend Dockerfile to pin a fixed version of mariadb-client ([#1581](https://github.com/ScilifelabDataCentre/dds_web/pull/1581)

22 changes: 19 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,25 @@ def fill_basic_db(db):
def new_test_db(uri):
dbname = uri[uri.rindex("/") + 1 :]
dbname_base = DATABASE_URI_BASE[DATABASE_URI_BASE.rindex("/") + 1 :]
dump_args = ["mysqldump", "-h", "db", "-u", "root", f"-p{mysql_root_password}", dbname_base]
load_args = ["mysql", "-h", "db", "-u", "root", f"-p{mysql_root_password}", dbname]
proc1 = subprocess.run(dump_args, capture_output=True)
dump_args = [
"mariadb-dump",
"-h",
"db",
"-u",
"root",
f"-p{mysql_root_password}",
dbname_base,
]
load_args = [
"mariadb",
"-h",
"db",
"-u",
"root",
f"-p{mysql_root_password}",
dbname,
]

proc1 = subprocess.run(dump_args, stdout=subprocess.PIPE)
proc2 = subprocess.run(load_args, input=proc1.stdout, capture_output=True)

Expand Down

0 comments on commit d4290b7

Please sign in to comment.