未验证 提交 54dc1820 编写于 作者: L Lidi Zheng 提交者: GitHub

Provide custom sponge configs to exclude manual runs from testgrid (#26283) (#26313)

* Provide custom sponge configs

* Correct the script

* Allow test scripts to produce artifacts through Docker

* Overcome the direcotry clone in our docker script

* Expose TESTGRID_EXCLUDE and GIT_ORIGIN_URL through docker run

* Make sanity tests happy
上级 a1fe3856
......@@ -58,7 +58,12 @@ docker run \
-e "KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER" \
-e "KOKORO_BUILD_URL=$KOKORO_BUILD_URL" \
-e "KOKORO_JOB_NAME=$KOKORO_JOB_NAME" \
-e "KOKORO_ARTIFACTS_DIR=$KOKORO_ARTIFACTS_DIR" \
-e "GIT_ORIGIN_URL=$(git -C $git_root remote get-url origin)" \
-e "GIT_COMMIT_SHORT=$(git -C $git_root rev-parse --short HEAD)" \
-e "TESTGRID_EXCLUDE=$TESTGRID_EXCLUDE" \
-v "$git_root:/var/local/jenkins/grpc:ro" \
-v "$KOKORO_ARTIFACTS_DIR:$KOKORO_ARTIFACTS_DIR" \
-w /var/local/git/grpc \
--name="$CONTAINER_NAME" \
$EXTRA_DOCKER_ARGS \
......
......@@ -2238,6 +2238,31 @@ def test_csds(gcp, original_backend_service, instance_group, server_uri):
test_csds_timeout_s)
def maybe_write_sponge_properties():
"""Writing test infos to enable more advanced testgrid searches."""
if 'KOKORO_ARTIFACTS_DIR' not in os.environ:
return
if 'GIT_ORIGIN_URL' not in os.environ:
return
if 'GIT_COMMIT_SHORT' not in os.environ:
return
properties = [
# Technically, 'TESTS_FORMAT_VERSION' is not required for run_xds_tests.
# We keep it here so one day we may merge the process of writing sponge
# properties.
'TESTS_FORMAT_VERSION,2',
'TESTGRID_EXCLUDE,%s' % os.environ.get('TESTGRID_EXCLUDE', 0),
'GIT_ORIGIN_URL,%s' % os.environ['GIT_ORIGIN_URL'],
'GIT_COMMIT_SHORT,%s' % os.environ['GIT_COMMIT_SHORT'],
]
logger.info('Writing Sponge configs: %s', properties)
with open(
os.path.join(os.environ['KOKORO_ARTIFACTS_DIR'],
"custom_sponge_config.csv"), 'w') as f:
f.write("\n".join(properties))
f.write("\n")
def set_validate_for_proxyless(gcp, validate_for_proxyless):
if not gcp.alpha_compute:
logger.debug(
......@@ -2954,6 +2979,7 @@ class GcpState(object):
self.instance_groups = []
maybe_write_sponge_properties()
alpha_compute = None
if args.compute_discovery_document:
with open(args.compute_discovery_document, 'r') as discovery_doc:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册