Skip to content

Commit 195cb8a

Browse files
authored
Merge pull request #71 from hashicorp/travis-testacc-build-matrix
Travis CI: run acceptance tests; OS build matrix
2 parents 5ccf5c8 + 1df4cc8 commit 195cb8a

File tree

3 files changed

+32
-18
lines changed

3 files changed

+32
-18
lines changed

.travis.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
dist: trusty
2-
sudo: required
3-
services:
4-
- docker
51
language: go
62
go:
73
- "1.11.x"
4+
jobs:
5+
include:
6+
- os: linux
7+
dist: trusty
8+
sudo: required
9+
services:
10+
- docker
11+
script:
12+
- make test
13+
- make testacc
14+
- make vet
15+
- make website-test
16+
- os: osx
17+
script:
18+
- make test
19+
- make testacc
20+
- os: windows
21+
script:
22+
# TODO: ensure windows setup can support binary testing
23+
- TF_ACC=1 go test -v ./...
824
env:
925
- GO111MODULE=on GOFLAGS=-mod=vendor
1026

@@ -15,15 +31,6 @@ install:
1531
# See: https://github.com/golang/go/issues/12933
1632
- bash scripts/gogetcookie.sh
1733

18-
script:
19-
- make test
20-
- make vet
21-
- make website-test
22-
2334
branches:
2435
only:
2536
- master
26-
matrix:
27-
fast_finish: true
28-
allow_failures:
29-
- go: tip

archive/data_source_archive_file_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package archive
33
import (
44
"fmt"
55
"os"
6+
"path/filepath"
67
"regexp"
78
"testing"
89

@@ -58,6 +59,7 @@ func TestAccArchiveFile_Basic(t *testing.T) {
5859
r.TestCheckResourceAttrPtr("data.archive_file.foo", "output_size", &fileSize),
5960
),
6061
},
62+
6163
{
6264
Config: testAccArchiveFileMultiConfig,
6365
Check: r.ComposeTestCheckFunc(
@@ -96,7 +98,7 @@ data "archive_file" "foo" {
9698
}
9799
`
98100

99-
var tmpDir = os.TempDir() + "/test"
101+
var tmpDir = filepath.ToSlash(os.TempDir()) + "/test"
100102
var testAccArchiveFileOutputPath = fmt.Sprintf(`
101103
data "archive_file" "foo" {
102104
type = "zip"
@@ -133,10 +135,10 @@ data "archive_file" "foo" {
133135

134136
var testAccArchiveFileMultiConfig = `
135137
data "archive_file" "foo" {
136-
type = "zip"
137-
source {
138-
filename = "content.txt"
139-
content = "This is some content"
138+
type = "zip"
139+
source {
140+
filename = "content.txt"
141+
content = "This is some content"
140142
}
141143
output_path = "zip_file_acc_test.zip"
142144
}

archive/zip_archiver.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ func (a *ZipArchiver) ArchiveDir(indirname string, excludes []string) error {
9090
return err
9191
}
9292

93+
// ensure exclusions are OS compatible paths
94+
for i := range excludes {
95+
excludes[i] = filepath.FromSlash(excludes[i])
96+
}
97+
9398
if err := a.open(); err != nil {
9499
return err
95100
}

0 commit comments

Comments
 (0)