<commit_before>#!/bin/bash
################################################################################
##
##  Licensed to the Apache Software Foundation (ASF) under one or more
##  contributor license agreements.  See the NOTICE file distributed with
##  this work for additional information regarding copyright ownership.
##  The ASF licenses this file to You under the Apache License, Version 2.0
##  (the "License"); you may not use this file except in compliance with
##  the License.  You may obtain a copy of the License at
##
##      http://www.apache.org/licenses/LICENSE-2.0
##
##  Unless required by applicable law or agreed to in writing, software
##  distributed under the License is distributed on an "AS IS" BASIS,
##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
##  See the License for the specific language governing permissions and
##  limitations under the License.
##
################################################################################
##
## mini_run.sh - does an ant run on subdirectories.
##

if [ $# -lt 1 ]
    then
    echo "usage: mini_run.sh [FLAGS] <dir>|<file> ... "
    echo ""
    echo "   where <dir> represents a top-level test directory. For example: "
    echo "   components/Menu"
    echo ""
    echo "   or where <file> represents a specific test file. For example: "
    echo "   components/Menu/Properties/Menu_Properties.mxml"
    echo ""
    echo "   You can specify any number of directories or files. (Delimited by spaces)"
    echo "   if you designate -caseName, you should only indicate one file"
    echo ""
    echo "   where [FLAGS] represents optional flags (before other args). Currently supported: "
    echo ""
    echo "   -addAntArg=<-Darg=val> - pass this arg to the ant script. may be repeated."
    echo ""
    echo "   -addArg=<compilerArg> - pass this arg to the compile for this run. may be repeated."
    echo ""
    echo "   -all         - run ALL TESTCASES locally. Report only failures. "
    echo "                  No other args should be used. This takes a long while. "
    echo ""
    echo "   -apollo      - (AIR) compile and run for AIR"
    echo ""
    echo "   -bug=<bugID> - excludes normally, but include testcases associated with <bugID>"
    echo ""
    echo "   -branch=<branch> - fetch excludes for the given branch "
    echo ""
    echo "   -browser     - run in default browser"
    echo ""
    echo "   -caseName=<testcase> - runs <testcase>, if you have also designated a file. "
    echo ""
    echo "   -covtimeout  - add a 30 second additional timeout to run. separate from other timeouts"
    echo ""
    echo "   -createImages - mixin the CreateBitmapReferences, to create baselines image files"
    echo ""
    echo "   -doCheck     - insert tests to database, checking keywords & duplicate testIDs"
    echo ""
    echo "   -debug       - add \"-debug\" to swf compilation "
    echo ""
    echo "   -failures    - run tests that failed last run (mini_run run)"
    echo "                  'Timed out' type failures will not be rerun"
    echo ""
    echo "   -hurricane   - ZIP and SEND files to hurricane server to create baselines."
    echo "                  Use regular file/directory arguments."
    echo "                  Will not run the tests locally. "
    echo ""
    echo "   -imageDiff   - mixin the EnableRemoteImageDiff include, to debug image compares"
    echo ""

    echo "   -keep        - (AIR) keep generated xml files in apollo run"
    echo ""
    echo "   -kw=<keyword> - limit run to test cases with <keyword>"
    echo "                   You can optionally indicate directories or files with -kw flags."
    echo ""
    echo "   -mail=name@address  send mail, if any, to this address only"
    echo ""
    echo "   -myExcludes  - do not fetch excludes from the database; use the ones already present in"
    echo "                  qa/sdk/testsuites/mustella/tests"
    echo ""
    echo "   -nofail      - ignore failures and continue processesing. "
    echo "                  REPORTS NO FAILURES. (useful for bitmap regeneration)"
    echo ""
    echo "   -norun       - don't run anything. If -doCheck, stop after that"
    echo ""
    echo "   -port=<runner port> - specify a port that the Runner will listen on. Ordinarily"
    echo "                         a user won't have to set this. "
    echo "                         because this is passed at compile time as a mixin, the"
    echo "                         only supported ports are 9999 and 10001"
    echo ""
    echo "   -quick       - Non-connectivity option: use existing excludes, skip cleanup"
    echo ""
    echo "   -results=log - get results via flashlog. (server style. Not always possible)"
    echo "   -results=wire- get results over the wire. (the default)"
    echo ""
    echo "   -retest=<bugID> - Run only the testcases associated with <bugID>. No file or dir args needed."
    echo "                  This is a rather narrow sense of retest. Cannot be used detached from db"
    echo ""
    echo "   -rerun       - run cases already compiled. Useful if re-configuring runtimes"
    echo "                  such as comparing standalone to browser, or browser to browser"
    echo ""
    echo "   -skipExclude - run testcases, ignoring any exclusions in the database"
    echo ""
    echo "   -smoke       - run the testcases designated in smoke.properties. must"
    echo "                  designate one or more directory arguments with this flag or use -all"
    echo "              also currently requires the presence of c:/tmp or /tmp  on your machine"
    echo "                  smoke.properties must be in the include text file format". 
    echo "                  designate directories or one or more smoke.properties files"
    echo "                  for example: "
    echo "                  ./mini_run.sh -smoke tests/components runs all of the smoke properties"
    echo "                  found in the subdirectories under components"
    echo "                  see: http://flexteam.macromedia.com/flexwiki/index.php/SDK:QA:mustella#Smoke_Tests"

    echo "   -sniffers    - mixin ALL sniffers (Event,Mouse,Pixel,Object) and playback control"
    echo ""

    echo "   -step_timeout=<seconds>   - ADD <seconds> to every test case step to avoid timeouts. "
    echo "                               useful in the context of running code coverage, etc. when "
    echo "                               things can get rather slow"
    echo ""
    echo "   -tier2       - run the testcases designated in tier2.properties files"
    echo "                  See -smoke for expected behavior" 
    echo " "
    
    echo ""
    echo "   -timeout=<seconds>  - set global test timeout to <seconds> (an int value). "
    echo ""
    echo "   -verbose     - Show more console output"
    echo ""
    echo ""
    echo ""

    exit
fi

if [ "$ANT_HOME" = "" ] 
    then
    echo "ANT_HOME is not set. Please set this variable"
    exit
fi

propfile=properties/mustella_tmp.properties
inherit_propfile=properties/mustella1.properties


hurricane=0
use_wire=true
propfileName=mustella_tmp
newFile=""
cleanFile=""
testName=""
seenFile=""
run_one_file=""
skipcheck=1;
skipexclude=false
imageDiff=0
sniffers=0
createImages=0
timeout=10000
smoke=""
print_passes=true
run_all=0
ant_target=run
browser_run=""
apollo_run=""
exit_on_compile_error=true
extra_arg=""
port=9999
keep=false
find_our_own_files=false

failed_only=0
no_run=0

beliteral=0

# local.properties should be optional
if [ -f "local.properties" ]<commit_msg>Changed default timeout from 10000 to 12000 to accomodate toolTip-hiding tests<commit_after>#!/bin/bash
################################################################################
##
##  Licensed to the Apache Software Foundation (ASF) under one or more
##  contributor license agreements.  See the NOTICE file distributed with
##  this work for additional information regarding copyright ownership.
##  The ASF licenses this file to You under the Apache License, Version 2.0
##  (the "License"); you may not use this file except in compliance with
##  the License.  You may obtain a copy of the License at
##
##      http://www.apache.org/licenses/LICENSE-2.0
##
##  Unless required by applicable law or agreed to in writing, software
##  distributed under the License is distributed on an "AS IS" BASIS,
##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
##  See the License for the specific language governing permissions and
##  limitations under the License.
##
################################################################################
##
## mini_run.sh - does an ant run on subdirectories.
##

if [ $# -lt 1 ]
    then
    echo "usage: mini_run.sh [FLAGS] <dir>|<file> ... "
    echo ""
    echo "   where <dir> represents a top-level test directory. For example: "
    echo "   components/Menu"
    echo ""
    echo "   or where <file> represents a specific test file. For example: "
    echo "   components/Menu/Properties/Menu_Properties.mxml"
    echo ""
    echo "   You can specify any number of directories or files. (Delimited by spaces)"
    echo "   if you designate -caseName, you should only indicate one file"
    echo ""
    echo "   where [FLAGS] represents optional flags (before other args). Currently supported: "
    echo ""
    echo "   -addAntArg=<-Darg=val> - pass this arg to the ant script. may be repeated."
    echo ""
    echo "   -addArg=<compilerArg> - pass this arg to the compile for this run. may be repeated."
    echo ""
    echo "   -all         - run ALL TESTCASES locally. Report only failures. "
    echo "                  No other args should be used. This takes a long while. "
    echo ""
    echo "   -apollo      - (AIR) compile and run for AIR"
    echo ""
    echo "   -bug=<bugID> - excludes normally, but include testcases associated with <bugID>"
    echo ""
    echo "   -branch=<branch> - fetch excludes for the given branch "
    echo ""
    echo "   -browser     - run in default browser"
    echo ""
    echo "   -caseName=<testcase> - runs <testcase>, if you have also designated a file. "
    echo ""
    echo "   -covtimeout  - add a 30 second additional timeout to run. separate from other timeouts"
    echo ""
    echo "   -createImages - mixin the CreateBitmapReferences, to create baselines image files"
    echo ""
    echo "   -doCheck     - insert tests to database, checking keywords & duplicate testIDs"
    echo ""
    echo "   -debug       - add \"-debug\" to swf compilation "
    echo ""
    echo "   -failures    - run tests that failed last run (mini_run run)"
    echo "                  'Timed out' type failures will not be rerun"
    echo ""
    echo "   -hurricane   - ZIP and SEND files to hurricane server to create baselines."
    echo "                  Use regular file/directory arguments."
    echo "                  Will not run the tests locally. "
    echo ""
    echo "   -imageDiff   - mixin the EnableRemoteImageDiff include, to debug image compares"
    echo ""

    echo "   -keep        - (AIR) keep generated xml files in apollo run"
    echo ""
    echo "   -kw=<keyword> - limit run to test cases with <keyword>"
    echo "                   You can optionally indicate directories or files with -kw flags."
    echo ""
    echo "   -mail=name@address  send mail, if any, to this address only"
    echo ""
    echo "   -myExcludes  - do not fetch excludes from the database; use the ones already present in"
    echo "                  qa/sdk/testsuites/mustella/tests"
    echo ""
    echo "   -nofail      - ignore failures and continue processesing. "
    echo "                  REPORTS NO FAILURES. (useful for bitmap regeneration)"
    echo ""
    echo "   -norun       - don't run anything. If -doCheck, stop after that"
    echo ""
    echo "   -port=<runner port> - specify a port that the Runner will listen on. Ordinarily"
    echo "                         a user won't have to set this. "
    echo "                         because this is passed at compile time as a mixin, the"
    echo "                         only supported ports are 9999 and 10001"
    echo ""
    echo "   -quick       - Non-connectivity option: use existing excludes, skip cleanup"
    echo ""
    echo "   -results=log - get results via flashlog. (server style. Not always possible)"
    echo "   -results=wire- get results over the wire. (the default)"
    echo ""
    echo "   -retest=<bugID> - Run only the testcases associated with <bugID>. No file or dir args needed."
    echo "                  This is a rather narrow sense of retest. Cannot be used detached from db"
    echo ""
    echo "   -rerun       - run cases already compiled. Useful if re-configuring runtimes"
    echo "                  such as comparing standalone to browser, or browser to browser"
    echo ""
    echo "   -skipExclude - run testcases, ignoring any exclusions in the database"
    echo ""
    echo "   -smoke       - run the testcases designated in smoke.properties. must"
    echo "                  designate one or more directory arguments with this flag or use -all"
    echo "              also currently requires the presence of c:/tmp or /tmp  on your machine"
    echo "                  smoke.properties must be in the include text file format". 
    echo "                  designate directories or one or more smoke.properties files"
    echo "                  for example: "
    echo "                  ./mini_run.sh -smoke tests/components runs all of the smoke properties"
    echo "                  found in the subdirectories under components"
    echo "                  see: http://flexteam.macromedia.com/flexwiki/index.php/SDK:QA:mustella#Smoke_Tests"

    echo "   -sniffers    - mixin ALL sniffers (Event,Mouse,Pixel,Object) and playback control"
    echo ""

    echo "   -step_timeout=<seconds>   - ADD <seconds> to every test case step to avoid timeouts. "
    echo "                               useful in the context of running code coverage, etc. when "
    echo "                               things can get rather slow"
    echo ""
    echo "   -tier2       - run the testcases designated in tier2.properties files"
    echo "                  See -smoke for expected behavior" 
    echo " "
    
    echo ""
    echo "   -timeout=<seconds>  - set global test timeout to <seconds> (an int value). "
    echo ""
    echo "   -verbose     - Show more console output"
    echo ""
    echo ""
    echo ""

    exit
fi

if [ "$ANT_HOME" = "" ] 
    then
    echo "ANT_HOME is not set. Please set this variable"
    exit
fi

propfile=properties/mustella_tmp.properties
inherit_propfile=properties/mustella1.properties


hurricane=0
use_wire=true
propfileName=mustella_tmp
newFile=""
cleanFile=""
testName=""
seenFile=""
run_one_file=""
skipcheck=1;
skipexclude=false
imageDiff=0
sniffers=0
createImages=0
timeout=12000
smoke=""
print_passes=true
run_all=0
ant_target=run
browser_run=""
apollo_run=""
exit_on_compile_error=true
extra_arg=""
port=9999
keep=false
find_our_own_files=false

failed_only=0
no_run=0

beliteral=0

# local.properties should be optional
if [ -f "local.properties" ]
{'fraction_non_alphanumeric': 0.1035162668419323, 'fraction_numerical': 0.005520867564903056, 'mean_word_length': 2.3397717295873575, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6051857', 'n_tokens_mistral': 4233, 'n_tokens_neox': 4062, 'n_words': 1664}