summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/elixir-httpoison-tag-network-dependent-test-cases.patch
blob: 763e20a6977c024f78f35d72005fcf0cc4020618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 788c481157871fe37becb2ec0280510061174e95 Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Sun, 21 Sep 2025 20:25:03 +0200
Subject: [PATCH] tests: Tag network dependent test cases.

Many environments, such as Linux distributions one, segragate builds
from accessing many system resources like Internet access. Currently it
is impossible to run the test suite offline, as it needs access to
badssl.com. This commit tags network dependent test cases to allow them
to be excluded in offline environments using mix test --exclude.

This holds at least for openSUSE Tumbleweed, NixOS, Guix System and
probably many others.
---
 test/httpoison_test.exs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/httpoison_test.exs b/test/httpoison_test.exs
index b260c65..f342b59 100644
--- a/test/httpoison_test.exs
+++ b/test/httpoison_test.exs
@@ -409,6 +409,7 @@ defmodule HTTPoisonTest do
       )
     end
 
+    @tag :network
     test "expired certificate" do
       assert {:error, %HTTPoison.Error{reason: {:tls_alert, {:certificate_expired, reason}}}} =
                HTTPoison.get("https://expired.badssl.com/")
@@ -440,6 +441,7 @@ defmodule HTTPoisonTest do
                )
     end
 
+    @tag :network
     test "allows changing TLS1.0 settings" do
       assert {:error,
               %HTTPoison.Error{
@@ -455,6 +457,7 @@ defmodule HTTPoisonTest do
       end
     end
 
+    @tag :network
     test "allows changing TLS1.1 settings" do
       assert {:error,
               %HTTPoison.Error{
@@ -472,6 +475,7 @@ defmodule HTTPoisonTest do
       end
     end
 
+    @tag :network
     test "does support tls1.2" do
       if :"tlsv1.2" in :ssl.versions()[:supported] do
         assert {:ok, _} = HTTPoison.get("https://tls-v1-2.badssl.com:1012/", [])
@@ -485,6 +489,7 @@ defmodule HTTPoisonTest do
       end
     end
 
+    @tag :network
     test "invalid common name" do
       assert {:error,
               %HTTPoison.Error{
-- 
2.51.0