Skip to content

Test suite requires active network connection #2409

@freakboy3742

Description

@freakboy3742

Describe the bug

The Briefcase test suite requires external network access to run. If the network

Steps to reproduce

  1. Turn off your wifi/network connection
  2. tox -m test

Test suite will fail ~23 tests, mostly related to downloading tools.

Expected behavior

Test suite should pass without network access being required.

Screenshots

No response

Environment

  • Operating System:All
  • Python version: All
  • Software versions:
    • Briefcase: 0.3.24

Logs

As of July 22, the test failures are:

FAILED tests/integrations/android_sdk/AndroidSDK/test_properties.py::test_cmdline_tools_url[Darwin-arm64-mac] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/android_sdk/AndroidSDK/test_properties.py::test_cmdline_tools_url[Darwin-x86_64-mac] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/android_sdk/AndroidSDK/test_properties.py::test_cmdline_tools_url[Linux-x86_64-linux] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/android_sdk/AndroidSDK/test_properties.py::test_cmdline_tools_url[Windows-AMD64-win] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Darwin-x86_64-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_x64_mac_hotspot_17.0.15_6.tar.gz-java17/Contents/Home-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Darwin-arm64-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.15_6.tar.gz-java17/Contents/Home-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Linux-x86_64-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz-java17-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Linux-aarch64-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.15_6.tar.gz-java17-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Linux-aarch64-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_arm_linux_hotspot_17.0.15_6.tar.gz-java17-True] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Linux-armv7l-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_arm_linux_hotspot_17.0.15_6.tar.gz-java17-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Linux-armv8l-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_arm_linux_hotspot_17.0.15_6.tar.gz-java17-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/java/test_JDK__verify.py::test_successful_jdk_download[Windows-AMD64-https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15+6/OpenJDK17U-jdk_x64_windows_hotspot_17.0.15_6.zip-java17-False] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeployGtkPlugin__properties.py::test_download_url - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeployQtPlugin__properties.py::test_download_url[Linux-x86_64-x86_64] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeployQtPlugin__properties.py::test_download_url[Linux-i686-i386] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeployQtPlugin__properties.py::test_download_url[Darwin-x86_64-x86_64] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeploy__properties.py::test_download_url[Linux-x86_64-x86_64] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeploy__properties.py::test_download_url[Linux-i686-i386] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/linuxdeploy/test_LinuxDeploy__properties.py::test_download_url[Darwin-x86_64-x86_64] - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/rcedit/test_RCEdit__properties.py::test_rcedit_url - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
FAILED tests/integrations/wix/test_WiX__verify.py::test_download_missing - httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
==================================================================== 21 failed, 3352 passed, 41 skipped in 82.22s (0:01:22) ====================================================================

Additional context

The fix for these tests should all be very similar - mocking the underlying httpx requests so that network access isn't required.

The network requirement access isn't normally a problem - but if the CI box (or the user) has an unstable network connection, it can manifest as test failures (see this example). These tests are also the slowest tests in the suite, so mocking will have the added benefit of speeding up the test suite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.good first issueIs this your first time contributing? This could be a good place to start!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions