File tree Expand file tree Collapse file tree 6 files changed +49
-8
lines changed Expand file tree Collapse file tree 6 files changed +49
-8
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,5 @@ install.*
1212
1313obj /
1414bin /
15- test /** /.vscode
15+ test /** /.vscode
16+ .logs /
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ install:
3333script :
3434 - npm test --silent
3535
36+ after_failure :
37+ - ./.travis/printLogs.sh
38+
39+ after_success :
40+ - ./.travis/printLogs.sh
41+
3642deploy :
3743 provider : releases
3844 api_key :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ---------------------------------------------------------------------------------------------
4+ # Copyright (c) Microsoft Corporation. All rights reserved.
5+ # Licensed under the MIT License. See License.txt in the project root for license information.
6+ # --------------------------------------------------------------------------------------------
7+
8+ fold_start () {
9+ echo -e " travis_fold:start:$1 \033[33;1m$2 \033[0m"
10+ }
11+
12+ fold_end () {
13+ echo -e " \ntravis_fold:end:$1 \r"
14+ }
15+
16+ fold_start testLogs " Test Logs"
17+
18+ for f in ./.logs/* .log
19+ do
20+ fold_start logFile $f
21+ cat $f
22+ fold_end logFile
23+ done
24+
25+ fold_end testLogs
Original file line number Diff line number Diff line change 22 * Copyright (c) Microsoft Corporation. All rights reserved.
33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
5+
56let Subscriber : ( message : string ) => void ;
67
78export function SubscribeToAllLoggers ( subscriber : ( message :string ) => void ) {
Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import * as fs from "fs" ;
7+
68import { SubscribeToAllLoggers } from "../../src/logger" ;
9+
710//
811// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
912//
@@ -16,7 +19,7 @@ import { SubscribeToAllLoggers } from "../../src/logger";
1619// to report the results back to the caller. When the tests are finished, return
1720// a possible error to the callback or null if none.
1821
19- var testRunner = require ( 'vscode/lib/testrunner' ) ;
22+ let testRunner = require ( 'vscode/lib/testrunner' ) ;
2023
2124// You can directly control Mocha options by uncommenting the following lines
2225// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
@@ -27,6 +30,14 @@ testRunner.configure({
2730 useColors : true // colored output from test results
2831} ) ;
2932
30- SubscribeToAllLoggers ( message => console . log ( message ) ) ;
33+ if ( process . env . OSVC_SUITE ) {
34+ if ( ! fs . existsSync ( "./.logs" ) ) {
35+ fs . mkdirSync ( "./.logs" ) ;
36+ }
37+
38+ let logFilePath = `./.logs/${ process . env . OSVC_SUITE } .log` ;
39+
40+ SubscribeToAllLoggers ( message => fs . appendFileSync ( logFilePath , message ) ) ;
41+ }
3142
3243module . exports = testRunner ;
Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import { SubscribeToAllLoggers } from "../../src/logger" ;
76//
87// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
98//
@@ -16,7 +15,7 @@ import { SubscribeToAllLoggers } from "../../src/logger";
1615// to report the results back to the caller. When the tests are finished, return
1716// a possible error to the callback or null if none.
1817
19- var testRunner = require ( 'vscode/lib/testrunner' ) ;
18+ let testRunner = require ( 'vscode/lib/testrunner' ) ;
2019
2120// You can directly control Mocha options by uncommenting the following lines
2221// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
@@ -27,6 +26,4 @@ testRunner.configure({
2726 useColors : true // colored output from test results
2827} ) ;
2928
30- SubscribeToAllLoggers ( message => console . log ( message ) ) ;
31-
32- module . exports = testRunner ;
29+ module . exports = testRunner ;
You can’t perform that action at this time.
0 commit comments