Skip to content

Commit d7a48d5

Browse files
code changes in config
1 parent 5ace0f2 commit d7a48d5

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

.circleci/config.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,6 @@ jobs:
4949
environment:
5050
GOIMAGE: << pipeline.parameters.goImage >>
5151

52-
download-demo-data:
53-
executor: machine-executor
54-
steps:
55-
- run: mkdir -p $HOME/resources
56-
- run:
57-
name: Download itzpapalotl demo foxx service
58-
command: |
59-
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
60-
echo "This is not a pull request. Skipping..."
61-
exit 0
62-
fi
63-
if ! [ -f "$HOME/resources/itzpapalotl-v1.2.0.zip" ]; then
64-
curl -L0 -o $HOME/resources/itzpapalotl-v1.2.0.zip "https://github.com/arangodb-foxx/demo-itzpapalotl/archive/v1.2.0.zip"
65-
fi
66-
- run: ls -l $HOME/resources
67-
- persist_to_workspace:
68-
root: ~/
69-
paths:
70-
- resources
71-
7252
run-integration-tests:
7353
executor: machine-executor
7454
parameters:
@@ -82,6 +62,14 @@ jobs:
8262
- checkout
8363
- attach_workspace:
8464
at: ~/
65+
- run:
66+
name: Create resources symlink
67+
command: |
68+
if [ -d "${HOME}/resources" ]; then
69+
sudo mkdir -p /tmp/resources
70+
sudo cp -r ${HOME}/resources/* /tmp/resources/
71+
ls -la /tmp/resources/
72+
fi
8573
- run: echo "TEST_RESOURCES=$TEST_RESOURCES"
8674
- run: ls -l $TEST_RESOURCES
8775
- run:
@@ -102,6 +90,26 @@ jobs:
10290
TEST_DISALLOW_UNKNOWN_FIELDS: false
10391
VERBOSE: 1
10492

93+
download-demo-data:
94+
executor: machine-executor
95+
steps:
96+
- run: mkdir -p $HOME/resources
97+
- run:
98+
name: Download itzpapalotl demo foxx service
99+
command: |
100+
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
101+
echo "This is not a pull request. Skipping..."
102+
exit 0
103+
fi
104+
if ! [ -f "$HOME/resources/itzpapalotl-v1.2.0.zip" ]; then
105+
curl -L0 -o $HOME/resources/itzpapalotl-v1.2.0.zip "https://github.com/arangodb-foxx/demo-itzpapalotl/archive/v1.2.0.zip"
106+
fi
107+
- run: ls -l $HOME/resources
108+
- persist_to_workspace:
109+
root: ~/
110+
paths:
111+
- resources
112+
105113
vulncheck:
106114
executor: golang-executor
107115
steps:
@@ -131,13 +139,11 @@ workflows:
131139
requires:
132140
- download-demo-data
133141
test-to-run: run-tests-cluster
134-
135142
- run-integration-tests:
136143
name: Test V2 cluster
137144
requires:
138145
- download-demo-data
139146
test-to-run: run-v2-tests-cluster
140-
141147
- run-integration-tests:
142148
name: Test V2 cluster - DB extra features (compression)
143149
requires:
@@ -150,12 +156,12 @@ workflows:
150156
requires:
151157
- download-demo-data
152158
test-to-run: run-tests-single
153-
154159
- run-integration-tests:
155160
name: Test V2 single
156161
requires:
157162
- download-demo-data
158163
test-to-run: run-v2-tests-single
164+
159165
# Weekly vulnerability check
160166
weekly_vulncheck:
161167
jobs:
@@ -168,4 +174,4 @@ workflows:
168174
cron: 0 6 * * 1
169175
filters:
170176
branches:
171-
only: master
177+
only: master

v2/tests/foxx_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package tests
2323
import (
2424
"context"
2525
"os"
26+
"path/filepath"
2627
"testing"
2728
"time"
2829

@@ -44,19 +45,22 @@ func Test_FoxxItzpapalotlService(t *testing.T) {
4445
}
4546

4647
// /tmp/resources/ directory is provided by .travis.yml
47-
zipFilePath1 := "/tmp/resources"
48+
zipFilePath1 := os.Getenv("TEST_RESOURCES")
49+
if zipFilePath1 == "" {
50+
zipFilePath1 = "/tmp/resources" // fallback for local testing
51+
}
52+
4853
if info, err := os.Stat(zipFilePath1); err != nil {
4954
if os.IsNotExist(err) {
5055
t.Skipf("path %s does not exist", zipFilePath1)
5156
}
5257
t.Fatalf("error checking path %s: %v", zipFilePath1, err)
5358
} else if !info.IsDir() {
54-
t.Skipf("path %s is not a directory", zipFilePath1)
59+
t.Skipf("path %s is not directory", zipFilePath1)
5560
}
5661

57-
zipFilePath := "/tmp/resources/itzpapalotl-v1.2.0.zip"
62+
zipFilePath := filepath.Join(zipFilePath1, "itzpapalotl-v1.2.0.zip")
5863
if _, err := os.Stat(zipFilePath); os.IsNotExist(err) {
59-
// Test works only via travis pipeline unless the above file exists locally
6064
t.Skipf("file %s does not exist", zipFilePath)
6165
}
6266
mountName := "test"

0 commit comments

Comments
 (0)