Commit c59be27
authored
Use local httpbin for integration testing (readmeio#185)
- add [go-httpbin](https://github.com/mccutchen/go-httpbin) as a local httpbin
- I thought it would be easier to deploy and use a go binary than deal with a python httpbin, plus httpbin isn't under active development any longer
- I had to make a few PRs to it but mostly it worked great
- add a reverse proxy container
- The only purpose of this container is to forward both 443 and 80 to the httpbin; at first I had been terminating TLS directly at the httpbin but that's hard with the test that requires port 80
- add a custom CA certificate, and TLS certificates generated by it
- I used `[mkcert](https://github.com/FiloSottile/mkcert)` to make the certificates, and left a script showing how I did it
- **note**: it is totally OK to check this private key in, it is useless for anything other than these tests
- update all the dockerfiles
- Since I had to run them a bunch of times in testing, moving the layers around so that the `ADD . /src` command came last made them much faster
- Settle all but the node on on a single version of alpine
- (can we upgrade the node version and library versions? Not for this PR, just curious)
- install the custom CA certificate on each of them
- update docker-compose to tell each environment to use the correct CA certificates
- update the fixtures to expect `go-httpbin` style responses
- mostly everything was the same, but there were minor differences
- `go-httpbin` puts all headers into an array, even if there was only one
- `go-httpbin` puts more stuff in the `form` field than does `httpbin`
- refactor src/integration.test.ts a bit
- I tried to have a light touch on this, but also I had to edit the code a bunch so I moved it around to make it a bit easier
- update python target to use `r.text` instead of `r.json()` because the former prints out the json it received, while the latter prints out the _python representation_ of the json it received, which breaks our tests
- I think this was working in the past because the alpine version was older and it was getting an older python and an older requests library
closes readmeio#1851 parent ae9f529 commit c59be27
48 files changed
Lines changed: 295 additions & 107 deletions
File tree
- integrations
- https-cert
- src
- fixtures/requests
- targets/python/requests
- fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 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 | + | |
3 | 32 | | |
| 33 | + | |
| 34 | + | |
4 | 35 | | |
5 | 36 | | |
6 | 37 | | |
7 | | - | |
| 38 | + | |
8 | 39 | | |
9 | 40 | | |
10 | 41 | | |
11 | 42 | | |
| 43 | + | |
12 | 44 | | |
13 | 45 | | |
| 46 | + | |
| 47 | + | |
14 | 48 | | |
15 | 49 | | |
16 | 50 | | |
17 | | - | |
| 51 | + | |
18 | 52 | | |
19 | 53 | | |
20 | 54 | | |
21 | 55 | | |
22 | 56 | | |
23 | 57 | | |
| 58 | + | |
| 59 | + | |
24 | 60 | | |
25 | 61 | | |
26 | 62 | | |
27 | | - | |
| 63 | + | |
28 | 64 | | |
29 | 65 | | |
30 | 66 | | |
31 | 67 | | |
| 68 | + | |
32 | 69 | | |
33 | 70 | | |
| 71 | + | |
| 72 | + | |
34 | 73 | | |
35 | 74 | | |
36 | 75 | | |
37 | | - | |
| 76 | + | |
38 | 77 | | |
39 | 78 | | |
40 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
2 | 10 | | |
3 | | - | |
4 | 11 | | |
5 | 12 | | |
6 | | - | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
8 | 20 | | |
9 | | - | |
10 | 21 | | |
11 | 22 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
16 | 26 | | |
17 | 27 | | |
18 | | - | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
2 | 14 | | |
3 | | - | |
4 | 15 | | |
5 | 16 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
9 | 20 | | |
10 | 21 | | |
11 | | - | |
12 | | - | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | | - | |
| 14 | + | |
7 | 15 | | |
8 | | - | |
9 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
| 20 | + | |
| 21 | + | |
0 commit comments