ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.14k stars 152 forks source link

Tests are failing in v3.3.0 #399

Closed julianfairfax closed 1 year ago

julianfairfax commented 1 year ago

Hello,

I am in the process of creating a Debian package for proton-bridge, and I'm getting an error about failing tests on v3.3.0. Here is the output of go test ./... from the v3.3.0 tag:

--- Failed steps:

  Scenario: bridge picks ports for IMAP and SMTP using default values. # features/bridge/default_ports.feature:3
    Then bridge IMAP port is 1143 # features/bridge/default_ports.feature:5
      Error: expected IMAP port to be 1143 but got 1144

  Scenario: bridge picks ports for IMAP wisely when default port is busy. # features/bridge/default_ports.feature:8
    Then bridge SMTP port is 1025 # features/bridge/default_ports.feature:12
      Error: expected SMTP port to be 1025 but got 1026

  Scenario: bridge picks ports for SMTP wisely when default port is busy. # features/bridge/default_ports.feature:14
    Then bridge IMAP port is 1143 # features/bridge/default_ports.feature:17
      Error: expected IMAP port to be 1143 but got 1144

  Scenario: Send at first start - one user default settings # features/bridge/heartbeat.feature:9
    Then bridge eventually sends the following heartbeat: # features/bridge/heartbeat.feature:14
      Error: timed out

  Scenario: Send at first start - one user telemetry disabled # features/bridge/heartbeat.feature:87
    Then bridge eventually sends the following heartbeat: # features/bridge/heartbeat.feature:96
      Error: timed out

  Scenario: Authenticates successfully on custom port # features/smtp/ports.feature:9
    When the user changes the SMTP port to 1144 # features/smtp/ports.feature:10
      Error: failed to create SMTP listener: listen tcp 127.0.0.1:1144: bind: address already in use

211 scenarios (203 passed, 6 failed, 2 undefined)
2748 steps (2736 passed, 6 failed, 6 skipped)
7m16.11416463s
--- FAIL: TestFeatures (436.17s)
    --- FAIL: TestFeatures/bridge_picks_ports_for_IMAP_and_SMTP_using_default_values. (0.01s)
        suite.go:449: expected IMAP port to be 1143 but got 1144
    --- FAIL: TestFeatures/bridge_picks_ports_for_IMAP_wisely_when_default_port_is_busy. (0.01s)
        suite.go:449: expected SMTP port to be 1025 but got 1026
    --- FAIL: TestFeatures/bridge_picks_ports_for_SMTP_wisely_when_default_port_is_busy. (0.01s)
        suite.go:449: expected IMAP port to be 1143 but got 1144
    --- FAIL: TestFeatures/Send_at_first_start_-_one_user_default_settings (30.76s)
        suite.go:449: timed out
    --- FAIL: TestFeatures/Send_at_first_start_-_one_user_telemetry_disabled (30.86s)
        suite.go:449: timed out
    --- FAIL: TestFeatures/Authenticates_successfully_on_custom_port#01 (0.87s)
        suite.go:449: failed to create SMTP listener: listen tcp 127.0.0.1:1144: bind: address already in use
    bdd_test.go:257: non-zero status returned, failed to run feature tests
FAIL
FAIL    github.com/ProtonMail/proton-bridge/v3/tests    436.322s
?       github.com/ProtonMail/proton-bridge/v3/utils    [no test files]
?       github.com/ProtonMail/proton-bridge/v3/utils/hasher [no test files]
?       github.com/ProtonMail/proton-bridge/v3/utils/port-blocker   [no test files]
?       github.com/ProtonMail/proton-bridge/v3/utils/versioner  [no test files]
FAIL

The full log is so long, that my terminal emulator can't display it all.

LBeernaertProton commented 1 year ago

Hey @julianfairfax , these tests are working correctly for us. Is it possible that you have other services running on those ports?

Out of curiosity: Is the .deb package we provide insufficient or are you trying to build everything against the debian packages?

julianfairfax commented 1 year ago

Hey @julianfairfax , these tests are working correctly for us. Is it possible that you have other services running on those ports?

Sorry for bothering you with this. I have the build running in a chroot, and I am using the bridge outside of it for my own personal use. So, it is my fault.

Out of curiosity: Is the .deb package we provide insufficient or are you trying to build everything against the debian packages?

Well, it's not available for arm64, which is unfortunate for mobile Linux. (Sidenote: it's possible to cross-compile for arm64. Here's the command for Debian at least GOARCH=arm64 CGO_ENABLED=1 CC=/usr/bin/aarch64-linux-gnu-gcc-11 PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig make build-nogui)

But in addition to that, it would be easier to install the package from Debian's repos, which I aim to get proton-bridge into, once i have everything working on the packaging side!