From fce1b2c577063a55292d87214b34b2eb5fa1209a Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Mon, 9 Dec 2024 18:17:55 +0100 Subject: [PATCH] feat: update to drawio-desktop 25.0.2 (#90) --- Dockerfile | 2 +- README.adoc | 2 +- src/unwanted-security-warnings.txt | 4 +--- tests/base.bats | 4 ++-- tests/{output.bats => error.bats} | 4 ++-- .../uniq-output-electron-security-warning.log | 2 +- ...ut-unknown-file-electron-security-warning.log | 7 +++++++ tests/export.bats | 16 ++++++++++------ tests/{issue-20.bats => issues.bats} | 2 +- 9 files changed, 26 insertions(+), 17 deletions(-) rename tests/{output.bats => error.bats} (59%) create mode 100644 tests/expected/uniq-output-unknown-file-electron-security-warning.log rename tests/{issue-20.bats => issues.bats} (86%) diff --git a/Dockerfile b/Dockerfile index acffbd4..1faa1e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ apt-get update apt-get install -y xvfb wget libgbm1 libasound2 # Drawio Desktop -DRAWIO_VERSION="24.7.17" +DRAWIO_VERSION="25.0.2" wget -q https://github.com/jgraph/drawio-desktop/releases/download/v${DRAWIO_VERSION}/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb apt-get install -y /opt/drawio-desktop/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb rm -rf /opt/drawio-desktop/drawio-${TARGETARCH}-${DRAWIO_VERSION}.deb diff --git a/README.adoc b/README.adoc index f4a8c26..bcb7f33 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,6 @@ = Draw.io Desktop Headless docker image -Dockerized headless version of https://github.com/jgraph/drawio-desktop[Draw.io Desktop v24.7.17] +Dockerized headless version of https://github.com/jgraph/drawio-desktop[Draw.io Desktop v25.0.2] == What it does diff --git a/src/unwanted-security-warnings.txt b/src/unwanted-security-warnings.txt index 1182fa6..c2ec305 100644 --- a/src/unwanted-security-warnings.txt +++ b/src/unwanted-security-warnings.txt @@ -1,7 +1,5 @@ -Failed to call method Failed to connect to the bus Failed to post task -Floss manager not present -Init observer found at shutdown +Floss manager service not available InitializeSandbox extension not supported diff --git a/tests/base.bats b/tests/base.bats index ab0c622..d373830 100755 --- a/tests/base.bats +++ b/tests/base.bats @@ -22,9 +22,9 @@ docker_test() { [ "$status" -eq $status ] # Test output if [ -f "tests/expected/$output_file.log" ]; then - diff -u --strip-trailing-cr "tests/output/$output_file-comp.log" "tests/expected/$output_file.log" >"tests/output/$output_file-diff.log" + diff -u --strip-trailing-cr "tests/expected/$output_file.log" "tests/output/$output_file-comp.log" >"tests/output/$output_file-diff.log" elif [ -f "tests/expected/uniq-$output_file.log" ]; then - diff -u --strip-trailing-cr <(sort -u "tests/output/$output_file-comp.log") "tests/expected/uniq-$output_file.log" >"tests/output/$output_file-diff.log" + diff -u --strip-trailing-cr "tests/expected/uniq-$output_file.log" <(sort -u "tests/output/$output_file-comp.log") >"tests/output/$output_file-diff.log" fi if [ -f "tests/output/$output_file-diff.log"]; then [ "$(cat "tests/output/$output_file-diff.log")" = "" ] diff --git a/tests/output.bats b/tests/error.bats similarity index 59% rename from tests/output.bats rename to tests/error.bats index 52c9dbb..0c1a5c0 100755 --- a/tests/output.bats +++ b/tests/error.bats @@ -6,6 +6,6 @@ docker_test "" 1 "output-unknown-file" "tests/data" -x unknown.drawio } -@test "Output electron security warning" { - docker_test "-e ELECTRON_DISABLE_SECURITY_WARNINGS=false" 0 "output-electron-security-warning" "tests/data" -x file1.drawio +@test "Output an error on unknown file with electron security warning" { + docker_test "-e ELECTRON_DISABLE_SECURITY_WARNINGS=false" 0 "output-unknown-file-electron-security-warning" "tests/data" -x unknown.drawio } diff --git a/tests/expected/uniq-output-electron-security-warning.log b/tests/expected/uniq-output-electron-security-warning.log index a76acf8..b1bf5dc 100644 --- a/tests/expected/uniq-output-electron-security-warning.log +++ b/tests/expected/uniq-output-electron-security-warning.log @@ -1,6 +1,6 @@ Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix") Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory -Floss manager not present, cannot set Floss enable/disable. +Floss manager service not available, cannot set Floss enable/disable. InitializeSandbox() called with multiple threads in process gpu-process. dri3 extension not supported. file1.drawio -> file1.pdf diff --git a/tests/expected/uniq-output-unknown-file-electron-security-warning.log b/tests/expected/uniq-output-unknown-file-electron-security-warning.log new file mode 100644 index 0000000..45b4208 --- /dev/null +++ b/tests/expected/uniq-output-unknown-file-electron-security-warning.log @@ -0,0 +1,7 @@ +Error: input file/directory not found +Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix") +Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory +Failed to post task from operator()@net/extras/sqlite/sqlite_persistent_shared_dictionary_store.cc:263 to client_task_runner_. +Floss manager service not available, cannot set Floss enable/disable. +InitializeSandbox() called with multiple threads in process gpu-process. +dri3 extension not supported. diff --git a/tests/export.bats b/tests/export.bats index a646aa2..f7a0ecd 100755 --- a/tests/export.bats +++ b/tests/export.bats @@ -6,14 +6,12 @@ docker_test "" 0 "export-file1" "tests/data" -x file1.drawio } -@test "Export a drawio file with space in its name" { - docker_test "" 0 "export-file2" "tests/data" -x "file 2.drawio" +@test "Export a drawio file as pdf with electron security warning" { + docker_test "-e ELECTRON_DISABLE_SECURITY_WARNINGS=false" 0 "output-electron-security-warning" "tests/data" -x file1.drawio } -@test "Export with check command" { - docker_test "" 1 "export-check-firstrun" "tests/data" -export --check file3.drawio - docker_test "" 1 "export-check-secondrun" "tests/data" -export --check file3.drawio - docker_test "" 1 "export-check-thirdrun" "tests/data" -export file3.drawio +@test "Export a drawio file with space in its name" { + docker_test "" 0 "export-file2" "tests/data" -x "file 2.drawio" } @test "Export as non-root" { @@ -23,3 +21,9 @@ @test "Export using unknown argument" { docker_test "" 0 "export-file1" "tests/data" --export file1.drawio --wrong-argument } + +@test "Export with check command" { + docker_test "" 1 "export-check-firstrun" "tests/data" -export --check file3.drawio + docker_test "" 1 "export-check-secondrun" "tests/data" -export --check file3.drawio + docker_test "" 1 "export-check-thirdrun" "tests/data" -export file3.drawio +} diff --git a/tests/issue-20.bats b/tests/issues.bats similarity index 86% rename from tests/issue-20.bats rename to tests/issues.bats index fcb9185..8263d2a 100755 --- a/tests/issue-20.bats +++ b/tests/issues.bats @@ -2,7 +2,7 @@ . tests/base.bats -@test "Issue 20 - frame bug / svg" { +@test "Issue 20 : frame bug / svg" { docker_test "" 0 "export-issue-20" "tests/data" -x -f svg issue-20/frame-bug.drawio diff <(xmllint --format tests/expected/issue-20-frame-bug.svg) <(xmllint --format tests/data/issue-20/frame-bug.svg) }