-
-
Notifications
You must be signed in to change notification settings - Fork 169
/
Copy pathtest.cmd
72 lines (65 loc) · 2.04 KB
/
test.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
git rev-parse --verify HEAD
git rev-parse "HEAD^"
:: Extract binary
md5sum binary/binary.tar.gz
tar xzvf binary/binary.tar.gz
if errorlevel 1 exit /b
if exist out\Release\node.exe ln -s out/Release Release
md5sum config.gypi icu_config.gypi Release/node.exe Release/node.lib Release/openssl-cli.exe Release/cctest.exe
if exist Release\embedtest.exe md5sum Release/embedtest.exe
:: Run the tests
call :diagnostics Before
set DEBUG_HELPER=1
call vcbuild.bat release noprojgen nobuild ignore-flaky %VCBUILD_TARGET%
set "EXIT_RETURN_VALUE=%errorlevel%"
ver > nul
call :diagnostics After
:: Convert test results
if exist test.tap (
tap2junit -i test.tap -o js-tests.junit.xml
if errorlevel 1 exit /b
)
if exist js-tests.junit.xml (
call %~dp0buildpulse.cmd js-tests.junit.xml
)
if exist cctest.tap (
tap2junit -i cctest.tap -o cctest.junit.xml
if errorlevel 1 exit /b
)
if exist cctest.junit.xml (
call %~dp0buildpulse.cmd cctest.junit.xml
)
:: The JUnit Plugin only marks the job as Unstable when it finds any kind of failure, including flaky tests.
:: We need to use the return code of vcbuild.bat to fail the job when there are real failures.
exit /b %EXIT_RETURN_VALUE%
:diagnostics
echo off
set "DIAGFILE=c:\jenkins_diagnostics.txt"
echo. >> %DIAGFILE%
echo. >> %DIAGFILE%
echo. >> %DIAGFILE%
set "TS=%date% %time%"
echo %TS%
echo %TS% >> %DIAGFILE%
echo %1 running vcbuild >> %DIAGFILE%
echo %BUILD_TAG% >> %DIAGFILE%
echo %BUILD_URL% >> %DIAGFILE%
echo %NODE_NAME% >> %DIAGFILE%
echo. >> %DIAGFILE%
echo netstat -abno >> %DIAGFILE%
netstat -abno >> %DIAGFILE% 2>&1
echo. >> %DIAGFILE%
echo tasklist /v >> %DIAGFILE%
tasklist /v >> %DIAGFILE% 2>&1
echo. >> %DIAGFILE%
echo tasklist /svc >> %DIAGFILE%
tasklist /svc >> %DIAGFILE% 2>&1
echo. >> %DIAGFILE%
echo wmic path win32_process get Caption,Processid,Commandline >> %DIAGFILE%
wmic path win32_process get Caption,Processid,Commandline | more >> %DIAGFILE% 2>&1
mv %DIAGFILE% %DIAGFILE%-OLD
cat %DIAGFILE%-OLD | sed s/\r//g;s/$/\r/ | tail -c 20000000 > %DIAGFILE%
rm %DIAGFILE%-OLD
echo on
tasklist | grep node
exit /b 0