Skip to content

Commit

Permalink
feat: update to drawio-desktop 22.0.3 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlespinasse committed Nov 13, 2023
1 parent a88eb0b commit 254a0de
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = true
[Makefile]
indent_style = tab
indent_size = 4

[*.log]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Makefile
Expand Up @@ -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}"

2 changes: 1 addition & 1 deletion 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

Expand Down
2 changes: 1 addition & 1 deletion 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
10 changes: 4 additions & 6 deletions 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
11 changes: 8 additions & 3 deletions tests/base.bats
Expand Up @@ -9,16 +9,21 @@ 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.
echo "$output" | tee "tests/output/$output_file.log" | sed 's#\[.*:.*/.*\..*:.*:.*\(.*\)\] ##' >"tests/output/$output_file-comp.log"

[ "$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
}
File renamed without changes.
1 change: 1 addition & 0 deletions tests/expected/output-create-command.log
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/expected/output-wrong-command.log
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion 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.
Expand Down
6 changes: 3 additions & 3 deletions tests/timeout.bats
Expand Up @@ -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
}

0 comments on commit 254a0de

Please sign in to comment.