<commit_before>trigger:
- master

strategy:
  matrix:
    linux:
      imageName: 'ubuntu-16.04'
    # The build needs docker so skipping macOS for now
    # mac:
    #  imageName: 'macOS-10.14'
    windows:
      imageName: 'vs2017-win2016'

pool:
  vmImage: $(imageName)

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'

- bash: |
    /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
    echo ">>> Started xvfb"
  displayName: Start xvfb
  condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- bash: |
    npm install --no-save
    npm install -g vsce
  displayName: Running npm install
  env:
    DISPLAY: ':99.0'

- bash: |
    npm run gulp
  displayName: Compiling

- bash: |
    npm run test
  displayName: Running unit tests

- bash: |
    npm run integration-test
  displayName: Running integration tests

- bash: |
    vsce package<commit_msg>Show logs from xvfb<commit_after>trigger:
- master

strategy:
  matrix:
    linux:
      imageName: 'ubuntu-16.04'
    # The build needs docker so skipping macOS for now
    # mac:
    #  imageName: 'macOS-10.14'
    windows:
      imageName: 'vs2017-win2016'

pool:
  vmImage: $(imageName)

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'

- bash: |
    # /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
    /usr/bin/Xvfb :99 -screen 0 1024x768x24 &
    echo ">>> Started xvfb"
  displayName: Start xvfb
  condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- bash: |
    npm install --no-save
    npm install -g vsce
  displayName: Running npm install
  env:
    DISPLAY: ':99.0'

- bash: |
    npm run gulp
  displayName: Compiling

- bash: |
    npm run test
  displayName: Running unit tests

- bash: |
    npm run integration-test
  displayName: Running integration tests

- bash: |
    vsce package
{'fraction_non_alphanumeric': 0.12090813093980993, 'fraction_numerical': 0.044350580781414996, 'mean_word_length': 2.7524752475247523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6300802', 'n_tokens_mistral': 775, 'n_tokens_neox': 679, 'n_words': 191}