diff --git a/.editorconfig b/.editorconfig index 7e94ddc..a422176 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ trim_trailing_whitespace = true [Makefile] indent_style = tab indent_size = 4 + +[*.log] +trim_trailing_whitespace = false diff --git a/Dockerfile b/Dockerfile index d90aac4..2a8fb3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ apt-get update apt-get install -y xvfb wget libgbm1 libasound2 # Drawio Desktop -DRAWIO_VERSION="21.8.2" +DRAWIO_VERSION="22.0.3" 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/Makefile b/Makefile index ddc4526..cc36c28 100644 --- a/Makefile +++ b/Makefile @@ -46,4 +46,3 @@ autoupdate-drawio-desktop: @sed -i 's/DRAWIO_VERSION=.*/DRAWIO_VERSION="$(DRAWIO_DESKTOP_RELEASE)"/' Dockerfile @sed -i 's/Draw\.io Desktop v.*/Draw.io Desktop v$(DRAWIO_DESKTOP_RELEASE)\]/' README.adoc @test -z "${GITHUB_OUTPUT}" || echo "release_version=$(DRAWIO_DESKTOP_RELEASE)" >> "${GITHUB_OUTPUT}" - diff --git a/README.adoc b/README.adoc index 0553039..6fda217 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 v21.8.2] +Dockerized headless version of https://github.com/jgraph/drawio-desktop[Draw.io Desktop v22.0.3] == What it does diff --git a/src/runner.sh b/src/runner.sh index a6eb41d..21417c0 100755 --- a/src/runner.sh +++ b/src/runner.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -euo pipefail -"${DRAWIO_DESKTOP_EXECUTABLE_PATH:?}" "$@" --no-sandbox +"${DRAWIO_DESKTOP_EXECUTABLE_PATH:?}" "$@" --no-sandbox --disable-gpu diff --git a/src/unwanted-security-warnings.txt b/src/unwanted-security-warnings.txt index ea75e03..145cee3 100644 --- a/src/unwanted-security-warnings.txt +++ b/src/unwanted-security-warnings.txt @@ -1,8 +1,6 @@ -Failed to connect to socket -Could not parse server address +Failed to call method +Failed to connect to the bus Floss manager not present -Exiting GPU process -called with multiple threads -extension not supported -Failed to send GpuControl.CreateCommandBuffer Init observer found at shutdown +InitializeSandbox +extension not supported diff --git a/tests/base.bats b/tests/base.bats index 4524246..1393613 100755 --- a/tests/base.bats +++ b/tests/base.bats @@ -9,6 +9,7 @@ docker_test() { shift shift shift + echo docker container run -t $docker_opts -w /data -v $(pwd)/${data_folder:-}:/data ${DOCKER_IMAGE} "$@" >>tests/output/$output_file-command.log run docker container run -t $docker_opts -w /data -v $(pwd)/${data_folder:-}:/data ${DOCKER_IMAGE} "$@" # Remove timed logging tags on electron logs by default. @@ -16,9 +17,13 @@ docker_test() { [ "$status" -eq $status ] if [ -f "tests/expected/$output_file.log" ]; then - [ "$(diff --strip-trailing-cr "tests/output/$output_file-comp.log" "tests/expected/$output_file.log")" = "" ] + diff -u --strip-trailing-cr "tests/output/$output_file-comp.log" "tests/expected/$output_file.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" + else + echo "No output test file at 'tests/expected/[uniq-]$output_file.log'" fi - if [ -f "tests/expected/uniq-$output_file.log" ]; then - [ "$(diff --strip-trailing-cr <(sort -u "tests/output/$output_file-comp.log") "tests/expected/uniq-$output_file.log")" = "" ] + if [ -f "tests/output/$output_file-diff.log"]; then + [ "$(cat "tests/output/$output_file-diff.log")" = "" ] fi } diff --git a/tests/expected/output-nothing.log b/tests/expected/output-check-command.log similarity index 100% rename from tests/expected/output-nothing.log rename to tests/expected/output-check-command.log diff --git a/tests/expected/output-create-command.log b/tests/expected/output-create-command.log new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/expected/output-create-command.log @@ -0,0 +1 @@ + diff --git a/tests/expected/output-wrong-command.log b/tests/expected/output-wrong-command.log new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/expected/output-wrong-command.log @@ -0,0 +1 @@ + diff --git a/tests/expected/uniq-output-electron-security-warning.log b/tests/expected/uniq-output-electron-security-warning.log index 0246447..c961db0 100644 --- a/tests/expected/uniq-output-electron-security-warning.log +++ b/tests/expected/uniq-output-electron-security-warning.log @@ -1,4 +1,4 @@ -Exiting GPU process due to errors during initialization +Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: unknown error type: 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. diff --git a/tests/timeout.bats b/tests/timeout.bats index e693062..24c4f3e 100755 --- a/tests/timeout.bats +++ b/tests/timeout.bats @@ -3,13 +3,13 @@ . tests/base.bats @test "Timeout for using create command" { - docker_test "-e DRAWIO_DESKTOP_COMMAND_TIMEOUT=2s" 1 "output-nothing" "tests" --create output/empty.drawio + docker_test "-e DRAWIO_DESKTOP_COMMAND_TIMEOUT=2s" 1 "output-create-command" "tests/data" --create } @test "Timeout for using check command" { - docker_test "-e DRAWIO_DESKTOP_COMMAND_TIMEOUT=2s" 1 "output-nothing" "tests" --check output/empty.drawio + docker_test "-e DRAWIO_DESKTOP_COMMAND_TIMEOUT=2s" 1 "output-check-command" "tests/data" --check /data/file1.drawio } @test "Timeout for using wrong command" { - docker_test "-e DRAWIO_DESKTOP_COMMAND_TIMEOUT=2s" 1 "output-nothing" "tests/data" --wrong-command + docker_test "-e DRAWIO_DESKTOP_COMMAND_TIMEOUT=2s" 1 "output-wrong-command" "tests/data" --wrong-command }