<commit_before>name: Linux browsers
on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main
jobs:
  build:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js
      uses: actions/setup-node@v3
      with:
        node-version: '16.x'
    - name: Install Firefox
      uses: browser-actions/setup-firefox@latest
      #with:
      #  firefox-version: '94.0'
    - name: Install latest Chrome
      run: |
        wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
        sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
        sudo apt-get update
        sudo apt-get --only-upgrade install google-chrome-stable
        google-chrome --version
    - name: Install Browsertime
      run: npm ci
    - name: Install dependencies
      run: |
        sudo apt-get install net-tools -y
        sudo snap install ffmpeg
        sudo snap alias ffmpeg.ffprobe ffprobe
        python -m pip install --upgrade --user pip
        python -m pip install --upgrade --user setuptools
        python -m pip install --user pyssim OpenCV-Python Numpy
        python -m pip --version
        python -m pip show Pillow
        python -m pip show pyssim
        python -m pip install virtualenv
        ./browsertime/visualmetrics.py --check
        sudo modprobe ifb numifbs=1
    - name: Browser versions
      run: |
        google-chrome --version
        firefox --version
    - name: Start local HTTP server
      run: (npm run start-server&)
    # - run: VTENV_OPTS="-p python3" make test
    - name: Test Firefox with throttle
      run: ./bin/browsertime.js -b firefox -n 1 http://127.0.0.1:3000/simple/ --connectivity.profile cable --connectivity.engine throttle --xvfb --firefox.collectMozLog
    - name: Test Chrome with CPU throttle and preURL
      run: ./bin/browsertime.js -b chrome --skipHar -n 1 --preURL http://127.0.0.1:3000/simple/ -r header:value --chrome.CPUThrottlingRate 2 --chrome.cdp.performance --xvfb --chrome.enableChromeDriverLog --chrome.collectConsoleLog http://127.0.0.1:3000/dimple/
    - name: Test pre/post scripts
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/measure.js -n 1 --preScript test/data/prepostscripts/preSample.js --postScript test/data/prepostscripts/postSample.js --xvfb
    - name: Test navigation and page complete check inactivity
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/navigateAndStartInTwoSteps.js -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
    - name: Test multi pages
      run: ./bin/browsertime.js -b firefox test/data/navigationscript/multi.js http://127.0.0.1:3000/search/ -n 1 --xvfb
    - name: Test multi pages with video and visual metrics
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/multi.js -n 3 --chrome.timeline --video --visualMetrics --visualElements --viewPort 1000x600 --xvfb
    #- name: Test Firefox Geckoprofiler
    #  run: ./bin/browsertime.js -b firefox --firefox.geckoProfiler -n 1 https://www.sitespeed.io/ --spa --xvfb
    - name: Test Firefox with scripting
      run: ./bin/browsertime.js -b firefox test/data/commandscripts/unified.js --xvfb
    - name: Test Chrome with emulated mobile
      run: ./bin/browsertime.js -b chrome --chrome.mobileEmulation.deviceName 'iPhone 6' http://127.0.0.1:3000/simple/ --xvfb
    - name: Test Firefox with web driver nagivation
      run: ./bin/browsertime.js -b firefox -n 1 http://127.0.0.1:3000/simple/ --webdriverPageload --xvfb
    - name: Test Chrome with web driver nagivation
      run: ./bin/browsertime.js -b chrome -n 1 http://127.0.0.1:3000/simple/ --webdriverPageload --xvfb
    - name: Test navigate to the same URL twice
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/sameURLTwice.js -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
    - name: Test navigate to the same URL twice by clicking on a link
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/sameURLTwiceWithClick.js -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
    - name: Test using alias for one URL
      run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ --urlAlias my_url --xvfb
    - name: Test using alias for multiple URLs
      run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ http://127.0.0.1:3000/dimple/ --urlAlias startPage --urlAlias documentation --xvfb  
    - name: Test collecting Firefox perf statistics
      run: ./bin/browsertime.js -b firefox --firefox.perfStats --xvfb http://127.0.0.1:3000/simple/
    - name: Run test with pre-test functionality
      run: ./bin/browsertime.js -b chrome --preWarmServer --xvfb http://127.0.0.1:3000/simple/
    - name: Run test with screenshots
      run: ./bin/browsertime.js -b chrome --screenshotLCP --screenshotLS --xvfb http://127.0.0.1:3000/simple/
    - name: Run test with visualMetricsPortable
      run: ./bin/browsertime.js -b chrome --visualMetricsPortable --xvfb http://127.0.0.1:3000/simple<commit_msg>Enable Geckoprofiler test again (#1785)<commit_after>name: Linux browsers
on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main
jobs:
  build:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js
      uses: actions/setup-node@v3
      with:
        node-version: '16.x'
    - name: Install Firefox
      uses: browser-actions/setup-firefox@latest
      #with:
      #  firefox-version: '94.0'
    - name: Install latest Chrome
      run: |
        wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
        sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
        sudo apt-get update
        sudo apt-get --only-upgrade install google-chrome-stable
        google-chrome --version
    - name: Install Browsertime
      run: npm ci
    - name: Install dependencies
      run: |
        sudo apt-get install net-tools -y
        sudo snap install ffmpeg
        sudo snap alias ffmpeg.ffprobe ffprobe
        python -m pip install --upgrade --user pip
        python -m pip install --upgrade --user setuptools
        python -m pip install --user pyssim OpenCV-Python Numpy
        python -m pip --version
        python -m pip show Pillow
        python -m pip show pyssim
        python -m pip install virtualenv
        ./browsertime/visualmetrics.py --check
        sudo modprobe ifb numifbs=1
    - name: Browser versions
      run: |
        google-chrome --version
        firefox --version
    - name: Start local HTTP server
      run: (npm run start-server&)
    # - run: VTENV_OPTS="-p python3" make test
    - name: Test Firefox with throttle
      run: ./bin/browsertime.js -b firefox -n 1 http://127.0.0.1:3000/simple/ --connectivity.profile cable --connectivity.engine throttle --xvfb --firefox.collectMozLog
    - name: Test Chrome with CPU throttle and preURL
      run: ./bin/browsertime.js -b chrome --skipHar -n 1 --preURL http://127.0.0.1:3000/simple/ -r header:value --chrome.CPUThrottlingRate 2 --chrome.cdp.performance --xvfb --chrome.enableChromeDriverLog --chrome.collectConsoleLog http://127.0.0.1:3000/dimple/
    - name: Test pre/post scripts
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/measure.js -n 1 --preScript test/data/prepostscripts/preSample.js --postScript test/data/prepostscripts/postSample.js --xvfb
    - name: Test navigation and page complete check inactivity
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/navigateAndStartInTwoSteps.js -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
    - name: Test multi pages
      run: ./bin/browsertime.js -b firefox test/data/navigationscript/multi.js http://127.0.0.1:3000/search/ -n 1 --xvfb
    - name: Test multi pages with video and visual metrics
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/multi.js -n 3 --chrome.timeline --video --visualMetrics --visualElements --viewPort 1000x600 --xvfb
    - name: Test Firefox Geckoprofiler
      run: ./bin/browsertime.js -b firefox --firefox.geckoProfiler -n 1 http://127.0.0.1:3000/simple/ --xvfb
    - name: Test Firefox with scripting
      run: ./bin/browsertime.js -b firefox test/data/commandscripts/unified.js --xvfb
    - name: Test Chrome with emulated mobile
      run: ./bin/browsertime.js -b chrome --chrome.mobileEmulation.deviceName 'iPhone 6' http://127.0.0.1:3000/simple/ --xvfb
    - name: Test Firefox with web driver nagivation
      run: ./bin/browsertime.js -b firefox -n 1 http://127.0.0.1:3000/simple/ --webdriverPageload --xvfb
    - name: Test Chrome with web driver nagivation
      run: ./bin/browsertime.js -b chrome -n 1 http://127.0.0.1:3000/simple/ --webdriverPageload --xvfb
    - name: Test navigate to the same URL twice
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/sameURLTwice.js -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
    - name: Test navigate to the same URL twice by clicking on a link
      run: ./bin/browsertime.js -b chrome test/data/navigationscript/sameURLTwiceWithClick.js -n 1 --pageCompleteCheckInactivity --timeToSettle 1000 --xvfb
    - name: Test using alias for one URL
      run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ --urlAlias my_url --xvfb
    - name: Test using alias for multiple URLs
      run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ http://127.0.0.1:3000/dimple/ --urlAlias startPage --urlAlias documentation --xvfb  
    - name: Test collecting Firefox perf statistics
      run: ./bin/browsertime.js -b firefox --firefox.perfStats --xvfb http://127.0.0.1:3000/simple/
    - name: Run test with pre-test functionality
      run: ./bin/browsertime.js -b chrome --preWarmServer --xvfb http://127.0.0.1:3000/simple/
    - name: Run test with screenshots
      run: ./bin/browsertime.js -b chrome --screenshotLCP --screenshotLS --xvfb http://127.0.0.1:3000/simple/
    - name: Run test with visualMetricsPortable
      run: ./bin/browsertime.js -b chrome --visualMetricsPortable --xvfb http://127.0.0.1:3000/simple
{'fraction_non_alphanumeric': 0.12157700524373664, 'fraction_numerical': 0.03767721887745193, 'mean_word_length': 2.479391891891892, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 29, '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': '4009379', 'n_tokens_mistral': 3708, 'n_tokens_neox': 3374, 'n_words': 946}