Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
⚡ Fix tests (#10)
Browse files Browse the repository at this point in the history
* ⚡ Fix config test

* ⚡️ Fix VMess outbound test

* 🔧 Workaround: Disable IV check for tests

* 🔧 Fix source path

* 🔧 Workaround: Disable IV check for unencrypted shadowsocks

* 🪔 Codecov wants higher fetch depth

* ☂ Remove codecov

Co-authored-by: database64128 <[email protected]>
  • Loading branch information
AkinoKaede and database64128 authored Sep 4, 2021
1 parent 325656b commit 19ce248
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,3 @@ jobs:
export PATH=$(go env GOPATH)/bin:${PATH}
go install -v github.com/ory/go-acc@latest
go-acc --covermode=atomic -o=coverage.txt ./...
- name: Upload codecov
run: bash <(curl -s https://codecov.io/bash)
14 changes: 7 additions & 7 deletions infra/conf/v2ray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,12 @@ func TestV2RayConfig(t *testing.T) {
runMultiTestCase(t, []TestCase{
{
Input: `{
"outbound": {
"protocol": "freedom",
"settings": {}
},
"log": {
"access": "/var/log/v2ray/access.log",
"loglevel": "error",
"error": "/var/log/v2ray/error.log"
},
"inbound": {
"inbounds": [{
"streamSettings": {
"network": "ws",
"wsSettings": {
Expand All @@ -77,7 +73,7 @@ func TestV2RayConfig(t *testing.T) {
]
}
},
"inbounds": [{
{
"streamSettings": {
"network": "ws",
"wsSettings": {
Expand Down Expand Up @@ -106,7 +102,11 @@ func TestV2RayConfig(t *testing.T) {
]
}
}],
"outboundDetour": [
"outbounds": [
{
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole"
Expand Down
20 changes: 9 additions & 11 deletions infra/conf/vmess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ func TestVMessOutbound(t *testing.T) {
runMultiTestCase(t, []TestCase{
{
Input: `{
"vnext": [{
"address": "127.0.0.1",
"port": 80,
"users": [
{
"id": "e641f5ad-9397-41e3-bf1a-e8740dfed019",
"email": "[email protected]",
"level": 255
}
]
}]
"address": "127.0.0.1",
"port": 80,
"users": [
{
"id": "e641f5ad-9397-41e3-bf1a-e8740dfed019",
"email": "[email protected]",
"level": 255
}
]
}`,
Parser: loadJSON(creator),
Output: &outbound.Config{
Expand Down
15 changes: 9 additions & 6 deletions proxy/shadowsocks/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ func TestTCPRequest(t *testing.T) {
User: &protocol.MemoryUser{
Email: "[email protected]",
Account: toAccount(&Account{
Password: "tcp-password",
CipherType: CipherType_AES_128_GCM,
Password: "tcp-password",
CipherType: CipherType_AES_128_GCM,
DisableIvCheck: true,
}),
},
},
Expand All @@ -85,8 +86,9 @@ func TestTCPRequest(t *testing.T) {
User: &protocol.MemoryUser{
Email: "[email protected]",
Account: toAccount(&Account{
Password: "password",
CipherType: CipherType_AES_256_GCM,
Password: "password",
CipherType: CipherType_AES_256_GCM,
DisableIvCheck: true,
}),
},
},
Expand All @@ -101,8 +103,9 @@ func TestTCPRequest(t *testing.T) {
User: &protocol.MemoryUser{
Email: "[email protected]",
Account: toAccount(&Account{
Password: "password",
CipherType: CipherType_CHACHA20_POLY1305,
Password: "password",
CipherType: CipherType_CHACHA20_POLY1305,
DisableIvCheck: true,
}),
},
},
Expand Down
2 changes: 1 addition & 1 deletion testing/scenarios/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func genTestBinaryPath() {
}

func GetSourcePath() string {
return filepath.Join("github.com", "v2fly", "v2ray-core", "v4", "main")
return filepath.Join("github.com", "Shadowsocks-NET", "v2ray-go", "v4", "main")
}

func CloseAllServers(servers []*exec.Cmd) {
Expand Down
5 changes: 3 additions & 2 deletions testing/scenarios/shadowsocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ func TestShadowsocksNone(t *testing.T) {
defer tcpServer.Close()

account := serial.ToTypedMessage(&shadowsocks.Account{
Password: "shadowsocks-password",
CipherType: shadowsocks.CipherType_NONE,
Password: "shadowsocks-password",
CipherType: shadowsocks.CipherType_NONE,
DisableIvCheck: true,
})

serverPort := tcp.PickPort()
Expand Down

0 comments on commit 19ce248

Please sign in to comment.