[ 
https://issues.apache.org/jira/browse/BEAM-9944?focusedWorklogId=475624&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-475624
 ]

ASF GitHub Bot logged work on BEAM-9944:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Aug/20 01:19
            Start Date: 28/Aug/20 01:19
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #12673:
URL: https://github.com/apache/beam/pull/12673#discussion_r478777091



##########
File path: sdks/python/scripts/run_pytest.sh
##########
@@ -21,19 +21,71 @@
 # exit statuses of runs, special-casing 5, which says that no tests were
 # selected.
 #
+# Arguments:
 # $1 - suite base name
 # $2 - additional arguments to pass to pytest
+#
+# Options:
+# --cov         - code directory to report coverage
+# --cov-report  - code coverage report format
+# -p, --package - package names need to be tested
+#
+# Example usages:
+# - Run all tests and generate coverage report
+#   `$ ./run_pytest.sh envname posargs --cov-report xml:codecov.xml --cov 
apache_beam`
+# - Run tests under apache_beam.typehints and apache_beam.options packages
+#   `$ ./run_pytest.sh envname posargs -p apache_beam.typehints -p 
apache_beam.options
+
+test_packages=""
 
-envname=${1?First argument required: suite base name}
-posargs=$2
-coverage_report=$3
-coverage_root=$4
+check_argument_existence() {
+  if [[ -z "$2" ]] || [[ "$2" =~ ^-+ ]]; then
+    echo "Argument is required for this option: $1" 1>&2
+    exit 1
+  fi
+}
+
+for OPT in "$@"
+do
+  case $OPT in
+    -p | --package)
+      check_argument_existence "$1" "$2"
+      test_packages="${test_packages}${2} "

Review comment:
       isn't `${test_packages}` empty?

##########
File path: sdks/python/scripts/run_pytest.sh
##########
@@ -21,19 +21,71 @@
 # exit statuses of runs, special-casing 5, which says that no tests were
 # selected.
 #
+# Arguments:
 # $1 - suite base name
 # $2 - additional arguments to pass to pytest
+#
+# Options:
+# --cov         - code directory to report coverage
+# --cov-report  - code coverage report format
+# -p, --package - package names need to be tested
+#
+# Example usages:
+# - Run all tests and generate coverage report
+#   `$ ./run_pytest.sh envname posargs --cov-report xml:codecov.xml --cov 
apache_beam`

Review comment:
       What are valid examples  for envname and posargs? Can we list them here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 475624)
    Time Spent: 1h 40m  (was: 1.5h)

> Reduce PreCommit test to the minimum and move rest of them to PostCommit one
> ----------------------------------------------------------------------------
>
>                 Key: BEAM-9944
>                 URL: https://issues.apache.org/jira/browse/BEAM-9944
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: yoshiki obata
>            Assignee: yoshiki obata
>            Priority: P2
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> To reduce resource usage for PreCommit tests, these needs are to be met.
> - For low-priority Python, tests only in the typehints package are run when 
> PreCommit test called. And rest of them are moved to the PostCommit one.
> - For high-priority Python, PreCommit and PostCommit tests are AS IS. 
> - Assured that we can add more tests easily later if there is a need.
>   e.g. using filepath to identify which tests to run



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to