Skip to content

Commit a510cb9

Browse files
committed
migrating tests to new setup
1 parent 54b3eab commit a510cb9

File tree

6 files changed

+39
-13
lines changed

6 files changed

+39
-13
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ env:
2525
- SDK=DartStable
2626
- SDK=Deno1171
2727
- SDK=FlutterStable
28-
- SDK=Go
28+
- SDK=Go112Test
29+
- SDK=Go118Test
2930
- SDK=KotlinJava8
3031
- SDK=KotlinJava11
3132
- SDK=Node12

templates/go/client.go.twig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ func (clt *Client) Call(method string, path string, headers map[string]interface
189189
}
190190
clt.client = httpClient
191191
}
192-
return false
193-
}
194192

195193
if clt.selfSigned {
196194
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
@@ -259,11 +257,6 @@ func (clt *Client) Call(method string, path string, headers map[string]interface
259257
req.URL.RawQuery = rawQuery
260258
}
261259
}
262-
file, err := os.Open(path)
263-
if err != nil {
264-
return nil, err
265-
}
266-
defer file.Close()
267260

268261
// Set Custom headers
269262
for key, val := range headers {

templates/go/main.go.twig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ const (
1414
EmptyParentPropertyType = ""
1515
)
1616

17+
const (
18+
EmptyParentDocument = ""
19+
EmptyParentProperty = ""
20+
EmptyParentPropertyType = ""
21+
)
22+
23+
const (
24+
EmptyParentDocument = ""
25+
EmptyParentProperty = ""
26+
EmptyParentPropertyType = ""
27+
)
28+
1729
func main() {
1830
var EmptyArray = []interface{}{}
1931

tests/.DS_Store

0 Bytes
Binary file not shown.

tests/GoTest.php renamed to tests/Go112Test.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
namespace Tests;
44

5-
class GoTest extends Base
5+
class Go112Test extends Base
66
{
77
protected string $language = 'go';
88
protected string $class = 'Appwrite\SDK\Language\Go';
99
protected array $build = [
1010
'mkdir -p tests/tmp/go/src/github.com/repoowner/sdk-for-go',
1111
'cp -Rf tests/sdks/go/* tests/tmp/go/src/github.com/repoowner/sdk-for-go/'
1212
];
13-
protected array $envs = [
14-
'go1.12' => 'docker run --rm -v $(pwd):/app -w /app golang:1.12 sh -c "cd tests/languages/go/ && ./test.sh"',
15-
'go1.17' => 'docker run --rm -v $(pwd):/app -w /app golang:1.17 sh -c "cd tests/languages/go/ && ./test.sh"',
16-
];
13+
protected string $command =
14+
'docker run --rm -v $(pwd):/app -w /app golang:1.12 sh -c "cd tests/languages/go/ && ./test.sh"';
1715
protected array $expectedOutput = [
1816
...Base::FOO_RESPONSES,
1917
...Base::BAR_RESPONSES,

tests/Go118Test.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
class Go118Test extends Base
6+
{
7+
protected string $language = 'go';
8+
protected string $class = 'Appwrite\SDK\Language\Go';
9+
protected array $build = [
10+
'mkdir -p tests/tmp/go/src/github.com/repoowner/sdk-for-go',
11+
'cp -Rf tests/sdks/go/* tests/tmp/go/src/github.com/repoowner/sdk-for-go/'
12+
];
13+
protected string $command =
14+
'docker run --rm -v $(pwd):/app -w /app golang:1.18 sh -c "cd tests/languages/go/ && ./test.sh"';
15+
protected array $expectedOutput = [
16+
...Base::FOO_RESPONSES,
17+
...Base::BAR_RESPONSES,
18+
...Base::GENERAL_RESPONSES,
19+
...Base::EXTENDED_GENERAL_RESPONSES,
20+
...Base::EXCEPTION_RESPONSES,
21+
];
22+
}

0 commit comments

Comments
 (0)