Skip to content

Commit 4f0c534

Browse files
authored
Rewrite the contributing and test docs (#444)
This PR updates the console markups so we can we can quickly click and copy them.
1 parent 1642ea3 commit 4f0c534

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ defp deps do
1919
end
2020
```
2121

22-
Then, run `$ mix deps.get`.
22+
Then, run:
23+
24+
```sh
25+
mix deps.get
26+
```
2327

2428
## Usage
2529

@@ -106,13 +110,30 @@ Mint is a low-level client. If you need higher-level features such as connection
106110

107111
If you wish to contribute, check out the [issue list][issues] and let us know what you want to work on, so that we can discuss it and reduce duplicate work.
108112

109-
Tests are organized with tags. Integration tests that hit real websites over the internet are tagged with `:requires_internet_connection`. Proxy tests are tagged with `:proxy` and require that you run `DOCKER_USER="$UID:$GID" docker-compose up` from the Mint root directory in order to run (they are excluded by default when you run `$ mix test`). A few examples of running tests:
113+
Tests are organized with tags. Integration tests that hit real websites over the internet are tagged with `:requires_internet_connection`. Proxy tests are tagged with `:proxy` (excluded by default) and require that you start local proxy instance through Docker Compose (or Podman Compose) from the Mint root directory in order to run.
114+
115+
If you encounter `{:error, %Mint.TransportError{reason: :nxdomain}}` error during the integration test, this suggests your DNS-based adblocker (self-hosted or VPN) might be blocking social media sites used in the integration test cases.
116+
117+
Here are a few examples of running tests:
118+
119+
Run all default tests which including `:requires_internet_connection` except `:proxy`:
110120

111-
* `$ mix test` to run the test suite without caring about Docker and `docker-compose up`.
121+
```sh
122+
mix test
123+
```
124+
125+
Local tests, if you don't have an Internet connection available:
112126

113-
* `$ mix test --exclude integration` to only run local tests (for example, you don't have an internet connection available).
127+
```sh
128+
mix test --exclude requires_internet_connection
129+
```
114130

115-
* `$ mix test --include proxy` to run all tests, including proxy tests.
131+
Run all tests:
132+
133+
```sh
134+
DOCKER_USER="$UID:$GID" docker-compose up --detach # or podman-compose up --detach
135+
mix test --include proxy
136+
```
116137

117138
## License
118139

@@ -122,7 +143,7 @@ Copyright 2018 Eric Meadows-Jönsson and Andrea Leopardi
122143
you may not use this file except in compliance with the License.
123144
You may obtain a copy of the License at
124145

125-
http://www.apache.org/licenses/LICENSE-2.0
146+
https://www.apache.org/licenses/LICENSE-2.0
126147

127148
Unless required by applicable law or agreed to in writing, software
128149
distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)