Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improve test coverage in pkg #55

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

hwipl
Copy link
Contributor

@hwipl hwipl commented Feb 13, 2024

Improve test coverage in exported packages in pkg/

Copy link

Test Result

🙌 210 Tests pass

Test Details

🟢 TestAddrMonStartStop (0.00s)
🟢 TestAddrMonUpdates (0.00s)
🟢 TestNewAddrMon (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestNewMessage (0.00s)
🟢 TestNewOK (0.00s)
🟢 TestNewError (0.00s)
🟢 TestReadWriteMessage (0.00s)
🟢 TestRequestType (0.00s)
🟢 TestRequestData (0.00s)
🟢 TestRequestReply (0.00s)
🟢 TestRequestError (0.00s)
🟢 TestRequestClose (0.00s)
🟢 TestServerStartStop (0.00s)
🟢 TestServerRequests (0.00s)
🟢 TestNewServer (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestCPDStartStop (0.00s)
🟢 TestCPDHosts (0.00s)
🟢 TestCPDProbe (3.34s)
🟢 TestCPDResults (0.00s)
🟢 TestNewCPD (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestConfigLoad (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestVPNConfigUpdateValid (0.00s)
🟢 TestVPNConfigUpdateJSON (0.00s)
🟢 TestNewVPNConfigUpdate (0.00s)
🟢 TestRequestWaitClose (0.00s)
🟢 TestDaemonConnect (0.00s)
🟢 TestDaemonDisconnect (0.00s)
🟢 TestServiceStartStop (0.00s)
🟢 TestServiceRequests (0.00s)
🟢 TestServiceSetProperty (0.00s)
🟢 TestNewService (0.00s)
🟢 TestDevMonStartStop (0.00s)
🟢 TestDevMonUpdates (0.00s)
🟢 TestNewDevMon (0.00s)
🟢 TestConfigResolvConfDirs (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestDNSMonStartStop (0.01s)
🟢 TestDNSMonUpdates (0.00s)
🟢 TestNewDNSMon (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestProxyStartStop (0.00s)
🟢 TestProxyReports (0.00s)
🟢 TestProxySetRemotes (0.00s)
🟢 TestProxySetWatches (0.00s)
🟢 TestNewProxy (0.00s)
🟢 TestRemotesAdd (0.00s)
🟢 TestRemotesRemove (0.00s)
🟢 TestRemotesFlush (0.00s)
🟢 TestRemotesGet (0.00s)
🟢 TestNewRemotes (0.00s)
🟢 TestReportString (0.00s)
🟢 TestReportWaitDone (0.00s)
🟢 TestNewReport (0.00s)
🟢 TestWatchesAdd (0.00s)
🟢 TestWatchesAddTemp (0.00s)
🟢 TestWatchesRemove (0.00s)
🟢 TestWatchesCleanTemp (0.00s)
🟢 TestWatchesFlush (0.00s)
🟢 TestWatchesContains (0.00s)
🟢 TestNewWatches (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestConfigCheckExecutables (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestRunCmd (0.00s)
🟢 TestRunCmdOutput (0.00s)
🟢 TestRunIP (0.00s)
🟢 TestRunIPLink (0.00s)
🟢 TestRunIPAddress (0.00s)
🟢 TestRunIP4Route (0.00s)
🟢 TestRunIP6Route (0.00s)
🟢 TestRunIP4Rule (0.00s)
🟢 TestRunIP6Rule (0.00s)
🟢 TestRunSysctl (0.00s)
🟢 TestRunNft (0.00s)
🟢 TestRunResolvectl (0.00s)
🟢 TestRunResolvectlOutput (0.00s)
🟢 TestSetExecutables (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestConnectStartStop (0.00s)
🟢 TestConnectDisconnect (0.00s)
🟢 TestConnectEvents (0.00s)
🟢 TestNewConnect (0.00s)
🟢 TestProfileMonHandleEvent (0.00s)
🟢 TestProfileMonStartStop (0.00s)
🟢 TestNewProfileMon (0.00s)
🟢 TestSleepMonHandleSignal (0.00s)
🟢 TestSleepMonStartStop (0.00s)
🟢 TestSleepMonEvents (0.00s)
🟢 TestNewSleepMon (0.00s)
🟢 TestAddressesAdd (0.00s)
🟢 TestAddressesRemove (0.00s)
🟢 TestAddressesGet (0.00s)
🟢 TestNewAddresses (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestDevicesAdd (0.00s)
🟢 TestDevicesRemove (0.00s)
🟢 TestDevicesGetReal (0.00s)
🟢 TestDevicesGetVirtual (0.00s)
🟢 TestDevicesGetAll (0.00s)
🟢 TestNewDevices (0.00s)
🟢 TestExcludesAddStatic (0.00s)
🟢 TestExcludesAddDynamic (0.00s)
🟢 TestExcludesRemove (0.00s)
🟢 TestExcludesCleanup (0.00s)
🟢 TestExcludesStartStop (0.00s)
🟢 TestNewExcludes (0.00s)
🟢 TestSplitRoutingHandleDeviceUpdate (0.00s)
🟢 TestSplitRoutingHandleAddressUpdate (0.00s)
🟢 TestSplitRoutingHandleDNSReport (0.00s)
🟢 TestSplitRoutingStartStop (0.00s)
🟢 TestSplitRoutingDNSReports (0.00s)
🟢 TestNewSplitRouting (0.00s)
🟢 TestCleanup (0.00s)
🟢 TestAllowDevsAdd (0.00s)
🟢 TestAllowDevsRemove (0.00s)
🟢 TestNewAllowDevs (0.00s)
🟢 TestAllowHostsAdd (0.00s)
🟢 TestAllowHostsRemove (0.00s)
🟢 TestAllowHostsStartStop (0.00s)
🟢 TestAllowHostsUpdate (0.00s)
🟢 TestNewAllowHosts (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestTrafPolHandleDeviceUpdate (0.00s)
🟢 TestTrafPolHandleDNSUpdate (0.00s)
🟢 TestTrafPolHandleCPDReport (0.00s)
🟢 TestTrafPolStartStop (0.00s)
🟢 TestNewTrafPol (0.00s)
🟢 TestCleanup (0.00s)
🟢 TestCreateConfigSplit (0.00s)
🟢 TestCreateConfigUpdate (0.00s)
🟢 TestParseEnvironmentSplit (0.00s)
🟢 TestParseDNSSplitExcXML (0.00s)
🟢 TestParseBypassVSubnetsXML (0.00s)
🟢 TestGetPostAuthXML (0.00s)
🟢 TestParseDNSSplitExc (0.00s)
🟢 TestParseBypassVSubnets (0.00s)
🟢 TestParseDisableAlwaysOnVPN (0.00s)
🟢 TestParseEnvironment (0.00s)
🟢 TestSetupVPNDevice (0.00s)
🟢 TestTeardownVPNDevice (0.00s)
🟢 TestVPNSetupSetupDNS (0.00s)
🟢 TestVPNSetupTeardownDNS (0.00s)
🟢 TestVPNSetupCheckDNSProtocols (0.00s)
🟢 TestVPNSetupCheckDNSServers (0.00s)
🟢 TestVPNSetupCheckDNSDomain (0.00s)
🟢 TestVPNSetupEnsureDNS (0.00s)
🟢 TestVPNSetupStartStop (0.00s)
🟢 TestVPNSetupEvents (0.00s)
🟢 TestNewVPNSetup (0.00s)
🟢 TestCleanup (0.00s)
🟢 TestDBusClientSetGetConfig (0.00s)
🟢 TestDBusClientSetGetEnv (0.00s)
🟢 TestDBusClientSetGetLogin (0.00s)
🟢 TestDBusClientPing (0.00s)
🟢 TestDBusClientQuery (0.00s)
🟢 TestDBusClientSubscribe (0.00s)
🟢 TestDBusClientAuthenticate (0.00s)
🟢 TestDBusClientConnect (0.00s)
🟢 TestDBusClientDisconnect (0.00s)
🟢 TestNewDBusClient (0.00s)
🟢 TestNewClient (0.00s)
🟢 TestConfigCopy (0.00s)
🟢 TestConfigEmpty (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestConfigExpand (0.00s)
🟢 TestNewConfig (0.00s)
🟢 TestLoadConfig (0.00s)
🟢 TestLoadUserSystemConfig (0.00s)
🟢 TestLoginInfoCopy (0.00s)
🟢 TestLoginInfoValid (0.00s)
🟢 TestLoginInfoParseLine (0.00s)
🟢 TestLoginInfoFromJSON (0.00s)
🟢 TestDNSRemotes (0.00s)
🟢 TestSplitDNSExcludes (0.00s)
🟢 TestConfigCopy (0.00s)
🟢 TestConfigEmpty (0.00s)
🟢 TestConfigEqual (0.00s)
🟢 TestConfigValid (0.00s)
🟢 TestConfigJSON (0.00s)
🟢 TestNew (0.00s)
🟢 TestNewFromJSON (0.00s)
🟢 TestTrustedNetworkTrusted (0.00s)
🟢 TestTrustedNetworkString (0.00s)
🟢 TestConnectionStateConnected (0.00s)
🟢 TestConnectionStateString (0.00s)
🟢 TestOCRunningRunning (0.00s)
🟢 TestOCRunningString (0.00s)
🟢 TestStatusCopy (0.00s)
🟢 TestJSON (0.00s)
🟢 TestNew (0.00s)
🟢 TestProfileGetAllowedHosts (0.00s)
🟢 TestProfileGetVPNServers (0.00s)
🟢 TestProfileGetVPNServerHostNames (0.00s)
🟢 TestProfileGetTNDServers (0.00s)
🟢 TestProfileGetTNDHTTPSServers (0.00s)
🟢 TestProfileGetAlwaysOn (0.00s)
🟢 TestProfileEqual (0.00s)
🟢 TestNewProfile (0.00s)
🟢 TestLoadProfile (0.00s)
🟢 TestLoadSystemProfile (0.00s)

Coverage

Total coverage: 🟩🟩🟥🟥 54.9%

Coverage Details
Coverage File Uncovered Lines
🟥🟥🟥🟥 0.0% /cmd/oc-client/main.go 5-7
🟥🟥🟥🟥 0.0% /cmd/oc-daemon-vpncscript/main.go 5-7
🟥🟥🟥🟥 0.0% /cmd/oc-daemon/main.go 5-7
🟩🟩🟩🟥 80.0% /internal/addrmon/addrmon.go 33-43, 77-79, 96-98
🟩🟩🟩🟩 100.0% /internal/api/config.go
🟩🟩🟩🟥 75.0% /internal/api/message.go 37-39, 64-66, 69-71, 72-74, 79-81, 95-97, 104-106
🟩🟩🟩🟥 87.5% /internal/api/request.go 40-42, 48-50
🟩🟥🟥🟥 43.4% /internal/api/server.go 42-76, 94-99, 110-124, 134-148, 153-156, 159-162, 164-166, 173-175, 179-181, 202-204, 205-207
🟥🟥🟥🟥 0.0% /internal/client/client.go 19-218
🟥🟥🟥🟥 0.0% /internal/client/cmd.go 29-214
🟩🟩🟩🟩 100.0% /internal/cpd/config.go
🟩🟩🟥🟥 63.7% /internal/cpd/cpd.go 30-32, 35-38, 40-43, 52-68, 84-85, 91-92, 105-107, 122-127, 130-133, 141-143, 153-157, 159-161, 164-173, 177-179, 193-195
🟥🟥🟥🟥 0.0% /internal/daemon/cmd.go 26-106
🟩🟩🟩🟩 100.0% /internal/daemon/config.go
🟥🟥🟥🟥 0.0% /internal/daemon/daemon.go 65-759
🟩🟩🟥🟥 73.7% /internal/daemon/vpnconfigupdate.go 21-23, 26-28, 29-31, 42-44, 53-55
🟩🟩🟩🟥 83.8% /internal/dbusapi/service.go 141-142, 146-148, 162-163, 167-169, 195-208, 216-218, 223-225, 226-228, 233-235, 297-299, 316-318, 381-381
🟩🟩🟩🟥 75.6% /internal/devmon/devmon.go 48-50, 56-58, 60-63, 78-88, 112-115, 122-124, 139-141
🟩🟩🟩🟩 100.0% /internal/dnsmon/config.go
🟩🟥🟥🟥 48.6% /internal/dnsmon/dnsmon.go 16-25, 33-33, 43-45, 47-49, 54-56, 65-83
🟩🟩🟩🟩 100.0% /internal/dnsproxy/config.go
🟩🟥🟥🟥 47.7% /internal/dnsproxy/proxy.go 33-111, 121-126, 130-132, 140-142, 149-151, 156-158, 204-206
🟩🟩🟩🟩 95.7% /internal/dnsproxy/remotes.go 45-48
🟩🟩🟩🟩 100.0% /internal/dnsproxy/report.go
🟩🟩🟩🟩 97.3% /internal/dnsproxy/watches.go 90-92
🟩🟩🟩🟩 100.0% /internal/execs/config.go
🟩🟩🟩🟥 93.1% /internal/execs/execs.go 20-22, 29-31
🟩🟩🟩🟩 100.0% /internal/ocrunner/config.go
🟥🟥🟥🟥 15.3% /internal/ocrunner/connect.go 49-193, 205-218, 222-227, 236-238, 242-243, 260-273, 301-331
🟩🟩🟥🟥 57.9% /internal/profilemon/profilemon.go 26-26, 34-37, 54-56, 58-60, 65-67, 72-92, 108-116
🟩🟩🟩🟥 77.8% /internal/sleepmon/sleepmon.go 26-26, 61-64, 73-76, 85-90, 105-107
🟩🟩🟩🟥 90.9% /internal/splitrt/addresses.go 37-39, 48-48
🟩🟩🟩🟥 83.3% /internal/splitrt/config.go 44-46, 48-50
🟩🟩🟩🟩 100.0% /internal/splitrt/devices.go
🟩🟩🟩🟩 95.0% /internal/splitrt/excludes.go 150-152, 155-157
🟩🟩🟩🟥 80.0% /internal/splitrt/filter.go 106-108, 113-115, 127-129, 132-134, 163-165, 189-191, 213-215
🟩🟩🟥🟥 67.6% /internal/splitrt/route.go 14-16, 20-22, 24-26, 30-32, 39-41, 45-47, 49-51, 57-59, 61-63, 69-71, 73-75
🟩🟩🟩🟥 85.9% /internal/splitrt/splitrt.go 70-74, 78-83, 111-113, 141-144, 173-176, 177-181, 242-247
🟩🟩🟩🟩 100.0% /internal/trafpol/allowdevs.go
🟩🟥🟥🟥 47.7% /internal/trafpol/allowhosts.go 24-24, 27-29, 36-47, 68-107, 176-193, 199-201, 207-233, 248-251, 258-278, 288-290
🟩🟩🟩🟩 100.0% /internal/trafpol/config.go
🟩🟩🟥🟥 51.2% /internal/trafpol/filter.go 158-160, 165-167, 173-175, 181-214, 232-234, 241-243
🟩🟩🟩🟥 86.0% /internal/trafpol/trafpol.go 32-34, 113-126
🟥🟥🟥🟥 0.0% /internal/vpncscript/client.go 12-44
🟥🟥🟥🟥 0.0% /internal/vpncscript/cmd.go 18-60
🟩🟩🟩🟥 82.9% /internal/vpncscript/config.go 24-26, 33-35, 50-52, 68-71, 86-92, 107-110, 118-120, 130-133, 141-143, 163-165
🟩🟩🟩🟥 94.7% /internal/vpncscript/env.go 141-144, 157-158, 392-395
🟩🟩🟥🟥 60.6% /internal/vpnsetup/vpnsetup.go 58-61, 69-75, 78-82, 92-98, 112-135, 141-146, 152-157, 163-166, 195-197, 200-202, 219-222, 225-227, 230-232, 352-440, 457-460, 475-494
🟩🟩🟩🟥 94.2% /pkg/client/client.go 125-127, 180-183, 191-201, 297-304, 360-360, 496-508, 523-527
🟩🟩🟩🟩 100.0% /pkg/client/config.go
🟩🟩🟩🟩 100.0% /pkg/logininfo/logininfo.go
🟩🟩🟩🟩 100.0% /pkg/vpnconfig/config.go
🟩🟩🟩🟩 100.0% /pkg/vpnstatus/status.go
🟩🟩🟩🟩 100.0% /pkg/xmlprofile/profile.go
🟥🟥🟥🟥 0.0% /tools/dbusclient/main.go 11-159
🟥🟥🟥🟥 0.0% /tools/devmon/main.go 8-14
🟥🟥🟥🟥 0.0% /tools/dnsproxy/main.go 19-82

@hwipl hwipl requested review from jandd and malaupa February 13, 2024 09:16
@hwipl hwipl merged commit c230756 into main Feb 13, 2024
2 checks passed
@hwipl hwipl deleted the feature/improve-test-coverage-in-pkg branch February 13, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants