Open fujiapple852 opened 1 year ago
GitHub actions can be connected to Tailscale:
https://github.com/tailscale/github-action
This would allow a cross-platform solution for case 2 above, with a Linux based TUN device in a remote machine made available via Tailscale.
Edit: works on Linux only so defeats the purpose
Whilst Trippy has some good unit tests for the
packet
andtracer
modules, it has has a very weak integration testing story right now, with no automated integration tests running in CI. Therefore each release requires manual testing for all functions on all platforms which is time consuming an error prone.The tracking issue outlines the various flavours of integration testing that could be added and run in CI.
1: Testing of the
trip
binary against a TUN device or a real networkRun real command like
trip example.com -m json
and validate the results. This covers everything e2e, except the Tui which may require another strategy to test.2: Testing the
tracing
module against a TUN deviceThis is the most important case as it allows us to test the platform specific idiosyncrasies related to the use of things like raw socket without having to fake anything inside Trippy. Running this in CI would gives us the most confidence in all changes which impact the
tracer
. This does not cover thedns
,backend
orfrontend
modules.This will require creating a TUN device which we can use to simulate a network that will receive packets from Trippy (ICMP, UDP & TCP) and respond with a variety of pre-canned responses to exercise all code paths.
3: Testing the
Tracer
with a mockNetwork
This will allow testing the
Tracer
algorithm against a dummyNetwork
which takes aProbe
and returns aProbeResponse
. This abstracts away all network logic.4: Testing the
net
module with a mockSocket
Similar to the above except this tests the
channel
module with a dummySocket
to abstract away platform specific behaviour.Tasks: