OperatorFoundation / shapeshifter-dispatcher

Shapeshifter Dispatcher converts Pluggable Transports that implement the Go API from the Pluggable Transports 2.1 specification into proxies usable by applications. Several proxy modes are provided, including proxying of both TCP and UDP traffic.
https://OperatorFoundation.org/
MIT License
177 stars 28 forks source link

Add a GitHub action to automate testing #42

Open certaintls opened 2 years ago

certaintls commented 2 years ago

Added the github action to automate the testing on Push and Pull Request. Through the work, I changed two additional things to make all the test green:

  1. I removed all manual setting of $GOPATH in the test, they were not working. I didn't spend time understanding how exactly they failed. Because newer go can set it automatically, see https://stackoverflow.com/a/53026674/1966269 . I tested at my local running the tests manually and in the pipeline (see the link below), golang can automatically handle $GOPATH.
  2. The test for SocksTCPStarbridge was missing, so I added one.

You can see the final version of this action passed all the tests https://github.com/certaintls/shapeshifter-dispatcher/actions/runs/2765284044

certaintls commented 2 years ago

@CryptoSax I think the locket feature broke all tests. For example, locally

vscode ➜ /workspaces/shapeshifter-dispatcher/shTests/SocksTCP (main ✗) $ sh ./runAllSocksTests.sh 
go build github.com/OperatorFoundation/shapeshifter-dispatcher/shTests/SocksTCP: no non-test Go files in /workspaces/shapeshifter-dispatcher/shTests/SocksTCP
SMETHODS DONE
SMETHODS DONE
SMETHODS DONE
CMETHOD Optimizer socks5 127.0.0.1:1443
CMETHODS DONE
./testSocksTCPOptimizerFirst.sh: line 30: pushd: shTests/SocksTCP: No such file or directory
sleeping
done with nap
this is the authentication method the socks server is sending:  5 9
this is the socks authentication variable: 9
10
accepted
Received an error while attempting to accept a connection:clientConfirmationCode and server copy not equal10 is the number of bytes being read
1
--- FAIL: TestSocksTCPOptimizerFirst (121.05s)
FAIL
exit status 1
FAIL    github.com/OperatorFoundation/shapeshifter-dispatcher/shTests/SocksTCP  121.053s
./testSocksTCPOptimizerFirst.sh: line 32: popd: directory stack empty
Test Failed
go build github.com/OperatorFoundation/shapeshifter-dispatcher/shTests/SocksTCP: no non-test Go files in /workspaces/shapeshifter-dispatcher/shTests/SocksTCP
SMETHODS DONE
SMETHODS DONE
SMETHODS DONE
CMETHOD Optimizer socks5 127.0.0.1:1443
CMETHODS DONE
./testSocksTCPOptimizerMinimizeDialDuration.sh: line 30: pushd: shTests/SocksTCP: No such file or directory
sleeping
done with nap
this is the authentication method the socks server is sending:  5 9
this is the socks authentication variable: 9
10
accepted
Received an error while attempting to accept a connection:clientConfirmationCode and server copy not equal

You can also see the broken tests in the pipeline: https://github.com/certaintls/shapeshifter-dispatcher/runs/8201150855?check_suite_focus=true#step:5:41