Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the hatch env selection to act as the tox one #13644

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Jan 6, 2023

What does this PR do?

Modify the way we select environments when we are using hatch to mirror what we were doing with tox.

Motivation

  • The latest weekly pipeline is all red since we migrated to hatch https://dev.azure.com/datadoghq/integrations-core/_build/results?buildId=123628&view=logs&j=762a2123-1c7c-5bf0-0e62-04885c3ecd74&t=e42a329a-2791-53f4-67fc-ce0c85b45aed
  • The select_hatch_envs also returns non-existing envs, which was not the case with the tox version:
    def select_tox_envs(
    check,
    envs_selected,
    style,
    format_style,
    benchmark,
    every,
    sort,
    e2e_tests_only,
    latest,
    env_filter_re,
    ):
    envs_available = get_available_tox_envs(check, sort=sort, e2e_only=latest, e2e_tests_only=e2e_tests_only)
    if format_style:
    envs_selected[:] = [e for e in envs_available if 'format_style' in e]
    elif style:
    envs_selected[:] = [e for e in envs_available if e in STYLE_CHECK_ENVS]
    elif benchmark:
    envs_selected[:] = [e for e in envs_available if 'bench' in e]
    elif latest:
    envs_selected[:] = [e for e in envs_available if e == 'latest']
    else:
    if every:
    envs_selected[:] = envs_available
    elif envs_selected:
    available = set(envs_selected) & set(envs_available)
    selected = []
    # Retain order and remove duplicates
    for e in envs_selected:
    # TODO: support globs or regex
    if e in available:
    selected.append(e)
    available.remove(e)
    envs_selected[:] = selected
    else:
    envs_selected[:] = [
    e for e in envs_available if 'bench' not in e and 'format_style' not in e and e != 'latest'
    ]
    if env_filter_re:
    envs_selected[:] = [e for e in envs_selected if not env_filter_re.match(e)]

Additional Notes

  • To reproduce, run ddev -v env test --base --new-env --junit --ddtrace datadog_checks_base:latest, it should generate a warn and not an error
  • I know we are not going to use tox in the future so we would be able to change the way ddev work in this case, but I think we need to do exactly what we were doing with it for now, and change this after if needed once we know that everything is alright (which is not the case right now)

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached
  • If the PR doesn't need to be tested during QA, please add a qa/skip-qa label.

@FlorentClarret FlorentClarret marked this pull request as ready for review January 6, 2023 14:11
@FlorentClarret FlorentClarret requested a review from a team as a code owner January 6, 2023 14:11
@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

Merging #13644 (24983f2) into master (c0daa8e) will increase coverage by 0.03%.
The diff coverage is n/a.

Flag Coverage Δ
activemq_xml 82.31% <ø> (ø)
aerospike 87.17% <ø> (+0.32%) ⬆️
airflow 90.00% <ø> (ø)
amazon_msk 88.67% <ø> (ø)
ambari 85.75% <ø> (ø)
apache 95.08% <ø> (ø)
arangodb 98.21% <ø> (ø)
argocd 88.43% <ø> (ø)
avi_vantage 92.50% <ø> (ø)
azure_iot_edge 82.00% <ø> (ø)
boundary 100.00% <ø> (ø)
btrfs 82.91% <ø> (ø)
cacti 87.90% <ø> (ø)
calico 83.33% <ø> (ø)
cassandra_nodetool 93.16% <ø> (ø)
ceph 91.02% <ø> (ø)
cert_manager 77.41% <ø> (ø)
cilium 75.34% <ø> (+0.93%) ⬆️
cisco_aci 95.27% <ø> (ø)
citrix_hypervisor 87.50% <ø> (ø)
clickhouse 95.31% <ø> (ø)
cloud_foundry_api 95.98% <ø> (ø)
cloudera 99.10% <ø> (ø)
cockroachdb 90.96% <ø> (ø)
consul 91.64% <ø> (ø)
coredns 94.54% <ø> (ø)
couch 95.19% <ø> (+0.24%) ⬆️
couchbase 83.58% <ø> (ø)
crio 89.79% <ø> (ø)
datadog_checks_base 89.52% <ø> (+0.33%) ⬆️
datadog_checks_dev 82.24% <ø> (+0.07%) ⬆️
datadog_checks_downloader 79.73% <ø> (ø)
datadog_cluster_agent 90.00% <ø> (ø)
ddev 98.58% <ø> (ø)
directory 96.50% <ø> (ø)
disk 91.69% <ø> (ø)
dns_check 93.90% <ø> (ø)
druid 97.70% <ø> (ø)
ecs_fargate 80.05% <ø> (ø)
eks_fargate 94.05% <ø> (ø)
elastic 91.61% <ø> (ø)
envoy 94.00% <ø> (ø)
etcd 93.96% <ø> (ø)
external_dns 89.09% <ø> (ø)
fluentd 94.77% <ø> (ø)
foundationdb 78.50% <ø> (-0.30%) ⬇️
gearmand 78.26% <ø> (+1.24%) ⬆️
gitlab_runner 91.94% <ø> (ø)
go_expvar 92.73% <ø> (ø)
gunicorn 92.85% <ø> (+0.75%) ⬆️
haproxy 95.12% <ø> (+0.16%) ⬆️
harbor 80.04% <ø> (ø)
hazelcast 92.39% <ø> (ø)
hdfs_datanode 89.74% <ø> (ø)
hdfs_namenode 86.72% <ø> (ø)
http_check 95.38% <ø> (+2.08%) ⬆️
ibm_ace 91.79% <ø> (ø)
ibm_db2 95.10% <ø> (ø)
ibm_i 81.95% <ø> (ø)
ibm_mq 91.37% <ø> (ø)
ibm_was 96.08% <ø> (ø)
impala 97.97% <ø> (ø)
istio 77.65% <ø> (+0.55%) ⬆️
kafka_consumer 84.06% <ø> (ø)
kong 87.56% <ø> (ø)
kube_apiserver_metrics 97.69% <ø> (ø)
kube_controller_manager 96.00% <ø> (ø)
kube_dns 95.97% <ø> (ø)
kube_metrics_server 94.87% <ø> (ø)
kube_proxy 96.80% <ø> (ø)
kube_scheduler 96.53% <ø> (ø)
kubelet 90.96% <ø> (ø)
kubernetes_state 89.18% <ø> (ø)
kyototycoon 85.96% <ø> (ø)
lighttpd 83.64% <ø> (ø)
linkerd 85.14% <ø> (+1.14%) ⬆️
linux_proc_extras 96.22% <ø> (ø)
mapr 82.70% <ø> (ø)
mapreduce 81.30% <ø> (-0.47%) ⬇️
marathon 83.12% <ø> (ø)
marklogic 96.03% <ø> (ø)
mcache 93.26% <ø> (ø)
mesos_master 89.75% <ø> (ø)
mesos_slave 93.63% <ø> (ø)
mongo 96.51% <ø> (ø)
nagios 89.01% <ø> (ø)
network 93.92% <ø> (+0.95%) ⬆️
nfsstat 95.20% <ø> (ø)
nginx 95.24% <ø> (+0.54%) ⬆️
nginx_ingress_controller 98.36% <ø> (ø)
openldap 96.33% <ø> (ø)
openmetrics 97.90% <ø> (ø)
openstack 51.45% <ø> (ø)
openstack_controller 90.93% <ø> (ø)
oracle 90.44% <ø> (ø)
pgbouncer 91.33% <ø> (ø)
php_fpm 90.25% <ø> (+0.84%) ⬆️
postfix 88.04% <ø> (ø)
powerdns_recursor 96.65% <ø> (ø)
process 85.42% <ø> (+0.28%) ⬆️
prometheus 94.17% <ø> (ø)
proxysql 98.97% <ø> (ø)
pulsar 100.00% <ø> (ø)
rabbitmq 94.45% <ø> (ø)
redisdb 87.50% <ø> (ø)
rethinkdb 97.93% <ø> (ø)
riak 99.22% <ø> (ø)
riakcs 93.61% <ø> (ø)
sap_hana 91.64% <ø> (ø)
scylla 100.00% <ø> (ø)
silk 93.33% <ø> (ø)
singlestore 90.81% <ø> (ø)
snowflake 96.47% <ø> (ø)
spark 93.57% <ø> (-0.29%) ⬇️
squid 100.00% <ø> (ø)
ssh_check 91.58% <ø> (ø)
statsd 87.36% <ø> (+4.21%) ⬆️
supervisord 92.30% <ø> (ø)
system_core 90.90% <ø> (ø)
system_swap 98.30% <ø> (ø)
tcp_check 91.58% <ø> (ø)
teamcity 88.35% <ø> (+2.87%) ⬆️
teradata 94.24% <ø> (ø)
tls 91.82% <ø> (+0.84%) ⬆️
tokumx 58.40% <ø> (?)
traffic_server 96.13% <ø> (ø)
twemproxy 79.45% <ø> (ø)
twistlock 79.62% <ø> (ø)
varnish 84.39% <ø> (+0.26%) ⬆️
vault 95.53% <ø> (+0.57%) ⬆️
vertica 98.50% <ø> (ø)
voltdb 96.84% <ø> (ø)
vsphere 89.91% <ø> (+0.08%) ⬆️
yarn 89.14% <ø> (ø)
zk 86.63% <ø> (+1.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@FlorentClarret FlorentClarret merged commit ff6adf8 into master Jan 9, 2023
@FlorentClarret FlorentClarret deleted the florentclarret/dcd/hatch-env branch January 9, 2023 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants