11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License.
33'use strict' ;
4-
5- //tslint:disable:trailing-comma no-any no-multiline-string
64import * as assert from 'assert' ;
75import { mount , ReactWrapper } from 'enzyme' ;
86import * as fs from 'fs-extra' ;
@@ -12,6 +10,7 @@ import * as React from 'react';
1210import { SemVer } from 'semver' ;
1311import * as TypeMoq from 'typemoq' ;
1412import { CancellationToken , Disposable , TextDocument , TextEditor } from 'vscode' ;
13+
1514import {
1615 IApplicationShell ,
1716 IDocumentManager ,
@@ -24,21 +23,20 @@ import { EXTENSION_ROOT_DIR } from '../../client/common/constants';
2423import { IDataScienceSettings } from '../../client/common/types' ;
2524import { createDeferred , Deferred } from '../../client/common/utils/async' ;
2625import { noop } from '../../client/common/utils/misc' ;
27- import { Architecture , OSType } from '../../client/common/utils/platform' ;
26+ import { Architecture } from '../../client/common/utils/platform' ;
2827import { EditorContexts , HistoryMessages } from '../../client/datascience/constants' ;
2928import { IHistoryProvider , IJupyterExecution } from '../../client/datascience/types' ;
3029import { InterpreterType , PythonInterpreter } from '../../client/interpreter/contracts' ;
3130import { CellButton } from '../../datascience-ui/history-react/cellButton' ;
3231import { MainPanel } from '../../datascience-ui/history-react/MainPanel' ;
3332import { IVsCodeApi } from '../../datascience-ui/react-common/postOffice' ;
3433import { updateSettings } from '../../datascience-ui/react-common/settingsReactSide' ;
35- import { IS_VSTS } from '../ciConstants' ;
36- import { isOs } from '../common' ;
3734import { sleep } from '../core' ;
3835import { DataScienceIocContainer } from './dataScienceIocContainer' ;
3936import { SupportedCommands } from './mockJupyterManager' ;
4037import { waitForUpdate } from './reactHelpers' ;
4138
39+ //tslint:disable:trailing-comma no-any no-multiline-string
4240enum CellInputState {
4341 Hidden ,
4442 Visible ,
@@ -62,7 +60,6 @@ suite('History output tests', () => {
6260 let globalAcquireVsCodeApi : ( ) => IVsCodeApi ;
6361 let ioc : DataScienceIocContainer ;
6462 let webPanelMessagePromise : Deferred < void > | undefined ;
65- const isRollingBuild = process . env ? process . env . VSCODE_PYTHON_ROLLING !== undefined : false ;
6663
6764 const workingPython : PythonInterpreter = {
6865 path : '/foo/bar/python.exe' ,
@@ -179,7 +176,7 @@ suite('History output tests', () => {
179176 // tslint:disable-next-line:no-console
180177 console . log ( `${ name } skipped, no Jupyter installed.` ) ;
181178 }
182- } ) . timeout ( 60000 ) ;
179+ } ) ;
183180 }
184181
185182 function verifyHtmlOnCell ( wrapper : ReactWrapper < any , Readonly < { } > , React . Component > , html : string | undefined , cellIndex : number | CellPosition ) {
@@ -423,12 +420,7 @@ suite('History output tests', () => {
423420 return path . join ( EXTENSION_ROOT_DIR , 'src' , 'test' , 'datascience' ) ;
424421 }
425422
426- runMountedTest ( 'Mime Types' , async function ( wrapper ) {
427- // This test hasn't yet succeeded in Linux on AzDO. See #3973
428- if ( IS_VSTS && isRollingBuild && isOs ( OSType . Linux ) ) {
429- // tslint:disable-next-line:no-invalid-this
430- return this . skip ( ) ;
431- }
423+ runMountedTest ( 'Mime Types' , async ( wrapper ) => {
432424
433425 const badPanda = `import pandas as pd
434426df = pd.read("${ escapePath ( path . join ( srcDirectory ( ) , 'DefaultSalesReport.csv' ) ) } ")
@@ -443,17 +435,17 @@ import time
443435
444436def spinning_cursor():
445437 while True:
446- for cursor in '|/-\\':
438+ for cursor in '|/-\\\\ ':
447439 yield cursor
448440
449441spinner = spinning_cursor()
450442for _ in range(50):
451443 sys.stdout.write(next(spinner))
452444 sys.stdout.flush()
453445 time.sleep(0.1)
454- sys.stdout.write('\r')` ;
446+ sys.stdout.write('\\ r')` ;
455447
456- addMockData ( badPanda , `pd has no attribute 'read'` , 'text/html' , 'error' ) ;
448+ addMockData ( badPanda , `pandas has no attribute 'read'` , 'text/html' , 'error' ) ;
457449 addMockData ( goodPanda , `<td>A table</td>` , 'text/html' ) ;
458450 addMockData ( matPlotLib , matPlotLibResults , 'text/html' ) ;
459451 const cursors = [ '|' , '/' , '-' , '\\' ] ;
@@ -470,16 +462,16 @@ for _ in range(50):
470462 } ) ;
471463
472464 await addCode ( wrapper , badPanda , 4 ) ;
473- verifyHtmlOnCell ( wrapper , `pd has no attribute 'read'` , CellPosition . Last ) ;
465+ verifyHtmlOnCell ( wrapper , `has no attribute 'read'` , CellPosition . Last ) ;
474466
475467 await addCode ( wrapper , goodPanda ) ;
476468 verifyHtmlOnCell ( wrapper , `<td>` , CellPosition . Last ) ;
477469
478470 await addCode ( wrapper , matPlotLib ) ;
479471 verifyHtmlOnCell ( wrapper , matPlotLibResults , CellPosition . Last ) ;
480472
481- await addCode ( wrapper , spinningCursor , 4 + ( cursors . length * 3 ) ) ;
482- verifyHtmlOnCell ( wrapper , '<xmp>\\</xmp> ' , CellPosition . Last ) ;
473+ await addCode ( wrapper , spinningCursor , 4 + ( ioc . mockJupyter ? ( cursors . length * 3 ) : 0 ) ) ;
474+ verifyHtmlOnCell ( wrapper , '<xmp>' , CellPosition . Last ) ;
483475 } ) ;
484476
485477 runMountedTest ( 'Undo/redo commands' , async ( wrapper ) => {
0 commit comments