test(e2e): run the library against a real Nextcloud - #56
Merged
Merged
Conversation
The playground answers for itself, which is what makes it quick and also what it cannot do: there is no server, so nothing that depends on one can be covered there. That is most of what the viewer touches, and all of the formats that need a preview rendered. This adds a second suite alongside it, not instead of it. A minimal app loads the built package into a container the way a host app would, and the tests upload a real file, sign in and open it from the Files list. The built package rather than the source, so what is tested is what gets published. It is a separate config and a separate npm script, because it costs a container and the twenty-second suite is the one to work in. The three formats it was written for do not pass yet, and skip with the reason: the library gates every preview-backed format on the server reporting which providers it has, and that capability does not exist until nextcloud/server#63954. Finding that out is most of what this is worth so far. What does pass is the whole path the formats will use, over a jpeg: real upload, real session, real preview, picture on screen. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
=======================================
Coverage 88.62% 88.62%
=======================================
Files 39 39
Lines 2743 2743
Branches 561 561
=======================================
Hits 2431 2431
Misses 305 305
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The playground answers for itself, which is what makes it finish in twenty seconds and also what it cannot do. There is no server behind it, so nothing that depends on one can be tested there, and that includes every format that needs a preview rendered.
This adds a second suite next to it rather than instead of it. A minimal app loads the built package into a container the way a host app would, and the tests upload a real file over WebDAV, sign in through the login form and open it from the Files list.
It loads
dist/rather than the source on purpose. What gets published is what should work on a server, so that is what the harness runs.Separate config, separate script, because it costs a container and the fast suite is the one to work in:
What it found
The three formats I wrote it for do not pass. They skip, with the reason.
The library gates every preview-backed format on
core.previews.enabled_providers, and that capability does not exist on server master. It is added byCoreCapabilities.phpin nextcloud/server#63954, which is still open. So on any current server,image/tiff,image/heic,image/jp2and the rest can never be offered however well the server renders them: no capability, no gating list, no handler.That is worth knowing on its own, and it is the sort of thing only a real server was ever going to tell us. It also means those three start passing the day #63954 lands, with no change here.
What does pass is the whole path they will use, over a jpeg: real upload, real session, the library loaded from its built package by an app, a server-rendered preview, and a decoded picture on screen.
Notes
The suite clicks the file in the list rather than using
?openfile=true. The harness app's script is added by an app, so it can register its file action after the Files app has already read that query; on a real server the viewer comes from core and is in time. Clicking is the path this suite is about anyway.e2e-server/js/is build output and gitignored.I have not wired this into CI. It wants a docker-enabled job and a decision about whether it gates merges or runs nightly, which seemed worth asking rather than assuming.
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.