Use gun in tests - #6098
Open
nickva wants to merge 1 commit into
Open
Conversation
nickva
force-pushed
the
gun-for-tests
branch
2 times, most recently
from
August 21, 2026 22:13
ab17723 to
26c8ba6
Compare
big-r81
reviewed
Aug 23, 2026
Since we have gun and it's proven its worth in nouveau let's use for tests as well. The bigger idea is to use for replication but let's make a smaller step first and see how it fares in unit and elixir tests. To help with unit tests created a simpler compatibility couch_gun module. It accepted some of the existing options and shapes of headers and auth parameters we already use everywhere. This helps avoid rewriting a whole lot of tests in one go. Dependency-wise we just have to ensure gun is started but otherwise it's already present there for nouveau so we don't need to bring anything new in, which is nice. Elixir tests used httpotion based on ibrowse. That client is deprecated we have been getting "httpotion is unmaintained" warnings for a while now (this was another reason to attempt this PR). Since httpotion was based on ibrowse we had to create a similar "helper" as for unit tests, just to handle some expected APIs from the callers. In many ways gun provides a nicer abstraction to streaming, so we could also simplify some of the worker start/stop and direct or pid:once hacks. Dependency-wise we don't have to do anything gun and cowlib are already present we can just clean up httpotion and ibrowse from elixir deps.
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.
Since we have gun and it's proven its worth in nouveau let's use for tests as well. The bigger idea is to use for replication but let's make a smaller step first and see how it fares in unit and elixir tests.
To help with unit tests created a simpler compatibility couch_gun module. It accepted some of the existing options and shapes of headers and auth parameters we already use everywhere. This helps avoid rewriting a whole lot of tests in one go. Dependency-wise we just have to ensure gun is started but otherwise it's already present there for nouveau so we don't need to bring anything new in, which is nice.
Elixir tests used httpotion based on ibrowse. That client is deprecated we have been getting "httpotion is unmaintained" warnings for a while now (this was another reason to attempt this PR). Since httpotion was based on ibrowse we had to create a similar "helper" as for unit tests, just to handle some expected APIs from the callers. In many ways gun provides a nicer abstraction to streaming, so we could also simplify some of the worker start/stop and direct or pid:once hacks. Dependency-wise we don't have to do anything gun and cowlib are already present we can just clean up httpotion and ibrowse from elixir deps.