1#
2# This file defines the tasks and platforms for WiredTiger in the
3# MongoDB continuous integration system (see https://mci.mongodb.com).
4#
5
6functions:
7  "fetch source" :
8    command: git.get_project
9    params:
10      directory: wiredtiger
11  "fetch binaries" : &fetch_binaries
12    - command: s3.get
13      params:
14        aws_key: ${aws_key}
15        aws_secret: ${aws_secret}
16        remote_file: wiredtiger/${build_variant}/${revision}/binaries/${build_id}.tgz
17        bucket: build_external
18        extract_to: wiredtiger
19
20pre:
21  - command: shell.exec
22    params:
23      script: |
24        rm -rf "wiredtiger"
25post:
26  - command: archive.targz_pack
27    params:
28      target: "wiredtiger.tgz"
29      source_dir: "wiredtiger"
30      include:
31        - "./**"
32  - command: s3.put
33    params:
34      aws_secret: ${aws_secret}
35      aws_key: ${aws_key}
36      local_file: wiredtiger.tgz
37      bucket: build_external
38      permissions: public-read
39      content_type: application/tar
40      display_name: Artifacts
41      remote_file: wiredtiger/${build_variant}/${revision}/artifacts/${build_id}.tgz
42  - command: shell.exec
43    params:
44      script: |
45        rm -rf "wiredtiger"
46
47tasks:
48## Base compile task on posix flavours
49  - name: compile
50    depends_on: []
51    commands:
52      - func: "fetch source"
53      - command: git.apply_patch
54        params:
55          directory: wiredtiger
56      - command: shell.exec
57        params:
58          working_dir: "wiredtiger"
59          script: |
60            set -o errexit
61            set -o verbose
62            if [ "Windows_NT" = "$OS" ]; then
63              scons.bat --enable-python=c:\\swigwin-3.0.2\\swig.exe --enable-diagnostic ${smp_command|}
64            else
65              ./build_posix/reconf
66              ${configure_env_vars|} ./configure --enable-diagnostic --enable-python --enable-zlib --enable-strict
67              ${make_command|make} ${smp_command|} 2>&1
68
69              # On macOS, change the binary location with install_name_tool since DYLD_LIBRARY_PATH
70              # appears not to work for dynamic modules loaded by python. For wt, the libtool generated
71              # script has the wrong path for running on test machines.
72              if [ "$(uname -s)" == "Darwin" ]; then
73                WT_VERSION=$(m4 build_posix/aclocal/version.m4)
74                install_name_tool -change /usr/local/lib/libwiredtiger-$WT_VERSION.dylib $(pwd)/.libs/libwiredtiger-$WT_VERSION.dylib lang/python/_wiredtiger*.so
75                install_name_tool -change /usr/local/lib/libwiredtiger-$WT_VERSION.dylib $(pwd)/.libs/libwiredtiger-$WT_VERSION.dylib .libs/wt
76              fi
77
78              ${test_env_vars|} TESTUTIL_ENABLE_LONG_TESTS=1 ${make_command|make} VERBOSE=1 check 2>&1
79            fi
80      - command: archive.targz_pack
81        params:
82          target: "wiredtiger.tgz"
83          source_dir: "wiredtiger"
84          include:
85             - "./**"
86      - command: s3.put
87        params:
88          aws_secret: ${aws_secret}
89          aws_key: ${aws_key}
90          local_file: wiredtiger.tgz
91          bucket: build_external
92          permissions: public-read
93          content_type: application/tar
94          display_name: Binaries
95          remote_file: wiredtiger/${build_variant}/${revision}/binaries/${build_id}.tgz
96
97  - name: unit-test
98    depends_on:
99    - name: compile
100    commands:
101      - func: "fetch binaries"
102      - command: shell.exec
103        params:
104          working_dir: "wiredtiger"
105          script: |
106            set -o errexit
107            set -o verbose
108
109            # Avoid /usr/bin/python, at least on macOS: with System Integrity
110            # Protection enabled, it ignores DYLD_LIBRARY_PATH and hence
111            # doesn't find the WiredTiger library in the local tree.
112            ${test_env_vars|} python ./test/suite/run.py -v 2 ${smp_command|} 2>&1
113
114  - name: compile-windows-alt
115    depends_on:
116    - name: compile
117    commands:
118      - func: "fetch binaries"
119      - command: shell.exec
120        params:
121          working_dir: "wiredtiger"
122          script: |
123            set -o errexit
124            set -o verbose
125
126            scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100 /we4133" wiredtiger.dll libwiredtiger.lib
127
128  - name: fops
129    depends_on:
130    - name: compile
131    commands:
132      - func: "fetch binaries"
133      - command: shell.exec
134        params:
135          working_dir: "wiredtiger"
136          script: |
137            set -o errexit
138            set -o verbose
139            if [ "Windows_NT" = "$OS" ]; then
140              cmd.exe /c t_fops.exe
141            else
142              ./test/fops/t
143            fi
144
145  - name: format
146    depends_on:
147    - name: compile
148    commands:
149      - func: "fetch binaries"
150      - command: shell.exec
151        params:
152          working_dir: "wiredtiger"
153          script: |
154            set -o errexit
155            set -o verbose
156            # format assumes we run it from the format directory
157            cmd.exe /c "cd test\\format && ..\\..\\t_format.exe reverse=0 encryption=none logging_compression=none runs=20"
158
159buildvariants:
160- name: ubuntu1404
161  display_name: Ubuntu 14.04
162  run_on:
163  - ubuntu1404-test
164  expansions:
165    # It's ugly, but we need the absolute path here, not the relative
166    test_env_vars: LD_LIBRARY_PATH=`pwd`/.libs
167    smp_command: -j $(grep -c ^processor /proc/cpuinfo)
168    configure_env_vars: CC=/opt/mongodbtoolchain/bin/gcc CXX=/opt/mongodbtoolchain/bin/g++
169  tasks:
170    - name: compile
171    - name: unit-test
172    - name: fops
173
174- name: windows-64
175  display_name: Windows 64-bit
176  run_on:
177  - windows-64-vs2013-test
178  tasks:
179    - name: compile
180    - name: compile-windows-alt
181    - name: unit-test
182    #- name: format  - Enable when we have a solution for hangs and crashses
183    - name: fops
184
185- name: macos-1012
186  display_name: OS X 10.12
187  run_on:
188  - macos-1012
189  expansions:
190    smp_command: -j $(sysctl -n hw.logicalcpu)
191    configure_env_vars: PATH=/opt/mongodbtoolchain/v2/bin:$PATH
192    make_command: PATH=/opt/mongodbtoolchain/v2/bin:$PATH ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future make
193    test_env_vars: PATH=/opt/mongodbtoolchain/v2/bin:$PATH DYLD_LIBRARY_PATH=`pwd`/.libs
194  tasks:
195    - name: compile
196    - name: unit-test
197    - name: fops
198
199