Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Dec 1, 2023
1 parent 06ebf03 commit 0d21f74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions internal/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ func (d *SlidingSyncDeployment) lockOptions(t *testing.T, options map[string]int
"options": options,
})
must.NotError(t, "failed to marshal options", err)
req, err := http.NewRequest("POST", magicMITMURL+"/options/lock", bytes.NewBuffer(jsonBody))
u := magicMITMURL + "/options/lock"
req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonBody))
must.NotError(t, "failed to prepare request", err)
req.Header.Set("Content-Type", "application/json")
res, err := d.mitmClient.Do(req)
must.NotError(t, "failed to do request", err)
must.NotError(t, "failed to POST "+u, err)
must.Equal(t, res.StatusCode, 200, "controller returned wrong HTTP status")
lockID, err = io.ReadAll(res.Body)
must.NotError(t, "failed to read response", err)
Expand Down Expand Up @@ -155,8 +156,8 @@ func RunNewDeployment(t *testing.T, shouldTCPDump bool) *SlidingSyncDeployment {
"--mode", "regular",
"-s", "/addons/__init__.py",
},
//WaitingFor: wait.ForLog("proxy listening"),
Networks: []string{networkName},
WaitingFor: wait.ForLog("loading complement crypto addons"),
Networks: []string{networkName},
NetworkAliases: map[string][]string{
networkName: {"mitmproxy"},
},
Expand Down Expand Up @@ -246,6 +247,7 @@ func RunNewDeployment(t *testing.T, shouldTCPDump bool) *SlidingSyncDeployment {
}
proxyURL, err := url.Parse(controllerURL)
must.NotError(t, "failed to parse controller URL", err)
t.Logf("mitm proxy url => %s", proxyURL.String())
return &SlidingSyncDeployment{
Deployment: deployment,
slidingSync: ssContainer,
Expand Down
3 changes: 2 additions & 1 deletion tests/addons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from status_code import StatusCode
from controller import MITM_DOMAIN_NAME, app

print("loading complement crypto addons")
addons = [
asgiapp.WSGIApp(app, MITM_DOMAIN_NAME, 80), # requests to this host will be routed to the flask app
StatusCode(),
]
# testcontainers will look for this log line
print("loading complement crypto addons", flush=True)

0 comments on commit 0d21f74

Please sign in to comment.