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

chore(golanglint-ci) disabling some linters for *_test.go files #703

Merged

Conversation

rluders
Copy link
Contributor

@rluders rluders commented Dec 9, 2022

This PR disables some linters for *_test.go files. Better to keep the tests independent and free of some unnecessary "clean code" stuff.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

N/A

Documentation

N/A

Unit Tests

N/A

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://issues.redhat.com/browse/???
https://access.redhat.com/solutions/???

@openshift-ci openshift-ci bot requested review from rhrmo and tremes December 9, 2022 08:56
@openshift-ci
Copy link

openshift-ci bot commented Dec 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rluders

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 9, 2022
.golangci.precommit.yml Outdated Show resolved Hide resolved
@rluders rluders force-pushed the chore/golangci-lint-no-tests branch from d483c91 to 2153dd3 Compare December 9, 2022 09:11
@rluders rluders requested review from tremes and removed request for rhrmo December 9, 2022 09:12
@tremes
Copy link
Contributor

tremes commented Dec 9, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 9, 2022
@rluders
Copy link
Contributor Author

rluders commented Dec 9, 2022

/retest

3 similar comments
@rluders
Copy link
Contributor Author

rluders commented Dec 10, 2022

/retest

@rluders
Copy link
Contributor Author

rluders commented Dec 13, 2022

/retest

@rluders
Copy link
Contributor Author

rluders commented Dec 13, 2022

/retest

@tremes
Copy link
Contributor

tremes commented Dec 14, 2022

Minor lint update.
/label px-approved
/label docs-approved

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Dec 14, 2022
@JoaoFula
Copy link
Contributor

/retest

@JoaoFula
Copy link
Contributor

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Dec 15, 2022
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9788fce and 2 for PR HEAD 2153dd3 in total

@rluders
Copy link
Contributor Author

rluders commented Jan 2, 2023

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jan 2, 2023

@rluders: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit b7240c5 into openshift:master Jan 2, 2023
JoaoFula pushed a commit to JoaoFula/insights-operator that referenced this pull request Jan 11, 2023
openshift-merge-robot pushed a commit that referenced this pull request Jan 11, 2023
* OCPBUGS-2249: fix the schema checking conditional gathering rules (#687)

* refactor(workloads_info): improving code reability (#650)

This was the first try to improve workloads_info reability.
It still have space to improve, but at least it reduces the funlen.

* OCPBUGS-2915: Updated info link in insights recommendations (#683)

* Updated info link in insights recommendations

* updated AdvisorURI in insightsreport

* unit tests update

* updated code in case of GetClusterVersion() error

* small fix in recommendation link

* reworking how info link gets cluster ID

* update of GetClusterVersion() in case of error

* Updated where clusterID is being set, created interface for mocking insightsClient inside unit tests

* updated interface name and noop-ed function in unit tests

* Use cgroups memory usage data in the archive metadata (#693)

* PR template preview and changelog update (#692)

* PR template preview and changelog update

fixed enhancements not being collected

* Enhancements in changelog fix

* Update CHANGELOG

* tiny changelog readme update

* removing backports from changelog

* OCPBUGS-3377: fix: storage/ceph path structure (#691)

* fix: storage/ceph path structure

* fix: archive filename path in docs

* docs(storage): adding storage to sample archive

* docs(gathered-data): update docs format

* docs(gathered-data): update cephcluster

* docs(gathered-data): update storagecluster

* docs(gathered-data): fix docs

* Change of kube-system namespace configmap location according to docs.  (#694)

* Changed the path of kube system namespace cluster config file to match the documented structure.

* Update of sample archive

* code updated according to review

* Updating ose-insights-operator images to be consistent with ART (#700)

Reconciling with https://github.com/openshift/ocp-build-data/tree/61541c1c730569d20db98c885bb07d7ee96e648c/images/ose-insights-operator.yml

Co-authored-by: AOS Automation Release Team <noreply@redhat.com>

* Update OpenShift versions & new Download time field (#705)

* OpenShift API update

* OpenShift client update

* Set the new download time field

* Update the CRD as well

* chore(golanglint-ci) disabling some linters for *_test.go files (#703)

* refactor(scheduler): move GatherSchedulerLogs to its own file (#701)

* refactor(webhookconfigurations): remove asset method and split tests (#702)

* OCPBUGS-5257 do not get disabled rules (#706)

There are two ways to disable a rule. First is to do that for particular
cluster. This would work with this original query parameter. Second is
to do that for your organization (multiple clusters) and this is not
currently supported by the API (and the query parameter).

* Update operator name in the OWNERS file (#712)

* OCPBUGS-5347: do not periodically update Available clusteroperator co… (#709)

* OCPBUGS-5347: do not periodically update Available clusteroperator condition in disabled state

* Make sure the conditions time are correct

* PR template preview and changelog update (#692)

* PR template preview and changelog update

fixed enhancements not being collected

* Enhancements in changelog fix

* Update CHANGELOG

* tiny changelog readme update

* removing backports from changelog

* OCPBUGS-3377: fix: storage/ceph path structure (#691)

* fix: storage/ceph path structure

* fix: archive filename path in docs

* docs(storage): adding storage to sample archive

* docs(gathered-data): update docs format

* docs(gathered-data): update cephcluster

* docs(gathered-data): update storagecluster

* docs(gathered-data): fix docs

* Change of kube-system namespace configmap location according to docs.  (#694)

* Changed the path of kube system namespace cluster config file to match the documented structure.

* Update of sample archive

* code updated according to review

* Updating ose-insights-operator images to be consistent with ART (#700)

Reconciling with https://github.com/openshift/ocp-build-data/tree/61541c1c730569d20db98c885bb07d7ee96e648c/images/ose-insights-operator.yml

Co-authored-by: AOS Automation Release Team <noreply@redhat.com>

* Update OpenShift versions & new Download time field (#705)

* OpenShift API update

* OpenShift client update

* Set the new download time field

* Update the CRD as well

* chore(golanglint-ci) disabling some linters for *_test.go files (#703)

* refactor(scheduler): move GatherSchedulerLogs to its own file (#701)

* refactor(webhookconfigurations): remove asset method and split tests (#702)

* OCPBUGS-5257 do not get disabled rules (#706)

There are two ways to disable a rule. First is to do that for particular
cluster. This would work with this original query parameter. Second is
to do that for your organization (multiple clusters) and this is not
currently supported by the API (and the query parameter).

* Update operator name in the OWNERS file (#712)

* OCPBUGS-5347: do not periodically update Available clusteroperator co… (#709)

* OCPBUGS-5347: do not periodically update Available clusteroperator condition in disabled state

* Make sure the conditions time are correct

Co-authored-by: Tomas Remes <tremes@users.noreply.github.com>
Co-authored-by: Ricardo Lüders <rluders@redhat.com>
Co-authored-by: Richard Hrmo <61187052+rhrmo@users.noreply.github.com>
Co-authored-by: OpenShift Bot <openshift-bot@redhat.com>
Co-authored-by: AOS Automation Release Team <noreply@redhat.com>
openshift-merge-robot pushed a commit that referenced this pull request Apr 6, 2023
* OCPBUGS-2249: fix the schema checking conditional gathering rules (#687)

* refactor(workloads_info): improving code reability (#650)

This was the first try to improve workloads_info reability.
It still have space to improve, but at least it reduces the funlen.

* OCPBUGS-2915: Updated info link in insights recommendations (#683)

* Updated info link in insights recommendations

* updated AdvisorURI in insightsreport

* unit tests update

* updated code in case of GetClusterVersion() error

* small fix in recommendation link

* reworking how info link gets cluster ID

* update of GetClusterVersion() in case of error

* Updated where clusterID is being set, created interface for mocking insightsClient inside unit tests

* updated interface name and noop-ed function in unit tests

* Use cgroups memory usage data in the archive metadata (#693)

* Update README.md

Just a dummy commit for a dummy PR. Only to run tests

* PR template preview and changelog update (#692)

* PR template preview and changelog update

fixed enhancements not being collected

* Enhancements in changelog fix

* Update CHANGELOG

* tiny changelog readme update

* removing backports from changelog

* OCPBUGS-3377: fix: storage/ceph path structure (#691)

* fix: storage/ceph path structure

* fix: archive filename path in docs

* docs(storage): adding storage to sample archive

* docs(gathered-data): update docs format

* docs(gathered-data): update cephcluster

* docs(gathered-data): update storagecluster

* docs(gathered-data): fix docs

* Change of kube-system namespace configmap location according to docs.  (#694)

* Changed the path of kube system namespace cluster config file to match the documented structure.

* Update of sample archive

* code updated according to review

* Updating ose-insights-operator images to be consistent with ART (#700)

Reconciling with https://github.com/openshift/ocp-build-data/tree/61541c1c730569d20db98c885bb07d7ee96e648c/images/ose-insights-operator.yml

Co-authored-by: AOS Automation Release Team <noreply@redhat.com>

* Update OpenShift versions & new Download time field (#705)

* OpenShift API update

* OpenShift client update

* Set the new download time field

* Update the CRD as well

* chore(golanglint-ci) disabling some linters for *_test.go files (#703)

* refactor(scheduler): move GatherSchedulerLogs to its own file (#701)

* refactor(webhookconfigurations): remove asset method and split tests (#702)

* OCPBUGS-5257 do not get disabled rules (#706)

There are two ways to disable a rule. First is to do that for particular
cluster. This would work with this original query parameter. Second is
to do that for your organization (multiple clusters) and this is not
currently supported by the API (and the query parameter).

* Update operator name in the OWNERS file (#712)

* OCPBUGS-5347: do not periodically update Available clusteroperator co… (#709)

* OCPBUGS-5347: do not periodically update Available clusteroperator condition in disabled state

* Make sure the conditions time are correct

* OCPBUGS-5347: additional fix (#716)

* Revert "OCPBUGS-5347: additional fix (#716)" (#717)

This reverts commit c857982.

* operators gatherer - handle ingresscontroller relatedObject & simplify (#714)

the code

* arch docs update - explain disabled=true status more (#721)

* arch docs update - explain disabled=true status more

* Minor wording fix

* chore(docs): update gathered documentation (#704)

* chore(docs): update gathered documentation

* chore(docs): conditional/pod_definition updated

* chore(docs): clusterconfig/pod_network_connectivity_checks updated

* chore(docs): clusterconfig/tsdb_status updated

* chore(docs): clusterconfig/silenced_alerts updated

* chore(docs): clusterconfig/sap_license_management_logs updated

* chore(docs): clusterconfig/sap_pods updated

* chore(docs): update gathered-data

* chore(docs): clusterconfig/openshift_snd_logs updated

* chore(docs): clusterconfig/openshift_machine_api_events updated

* chore(docs): clusterconfig/openshift_logging updated

* chore(docs): update gathered-data

* chore(docs): clusterconfig/sheduler updated

* chore(docs): clusterconfig/sheduler_logs updated

* chore(docs): clusterconfig/openshift_authentication_logs updated

* chore(docs): clusterconfig/openshift_apiserver_operator_logs updated

* chore(docs): fixes scheduler_logs and openshift_authentication_logs docs

* chore(docs): clusterconfig/olm_operators updated

* chore(docs): clusterconfig/nodes updated

* chore(docs): clusterconfig/node_logs updated

* docs(chore): fixes clusterconfig/olm_operatos bp version

* chore(docs): clusterconfig/netnamespaces updated

* chore(docs): clusterconfig/mutating_webhook_configurations updated

* chore(docs): clusterconfig/machine_sets updated

* chore(docs): clusterconfig/machine_healthchecks updated

* chore(docs): clusterconfig/machine_configs updated

* feat(gendoc): generate link to sample files

* chore(docs): update gathered-data

* chore(docs): fixes bp versions

* chore(docs): clusterconfig/machine_configs updated

* chore(docs): clusterconfig/machine_autoscalers updated

* chore(docs): clusterconfig/kube_controller_manager_logs updated

* chore(docs): clusterconfig/jaegers updated

* chore(docs): clusterconfig/install_plans updated + clean global var

* chore(docs): clusterconfig/ceph_cluster updated

* chore(docs): update clusterconfig/active_alerts + unecessary global const

* chore(docs): update clusterconfig/certificate_signing_requests + unecessary global const

* chore(docs): clusterconfig/authentications updated

* chore(docs): clusterconfig/feature_gates updated

* chore(docs): clusterconfig/image updated

* chore(docs): clusterconfig/image_pruners updated

* chore(docs): clusterconfig/infrastructure updated

* chore(docs): clusterconfig/ingress updated

* chore(docs): clusterconfig/networks updated

* fix(image_registries) remove var from package scope

* chore(docs): clusterconfig/oauths updated

* chore(docs): clusterconfig/proxies updated

* refactor(service_accounts): remove global constant

* chore(docs): update gathered-data for preview

* chore(docs): clusterconfig/container_images updated

* chore(docs): clusterconfig/container_runtime_configs updated

* chore(docs): clusterconfig/cost_management_metrics_configs updated

* chore(docs): clusterconfig/custom_resource_definitions updated

* refactor(dvo_metrics): remove global scope variables

* chore(docs): clusterconfig/dvo_metrics updated

* chore(docs): clusterconfig/host_subnets updated

* chore(docs): clusterconfig/operators_pods_events updated

* chore(docs): update gathered-data

* chore(docs): clusterconfig/image_registries updated

* chore(docs): clusterconfig/operators updated

* chore(version): remove TODOs and create tracking task for it

* chore(docs): conditional/api_request_counts_of_resource_from_alert updated

* chore(docs): conditional/containers_logs

* chore(docs): conditional/logs_of_namespace updated

* chore(gendoc): clean up blankline

* chore(gendoc): simplify samplearchive regex

* chore(docs): conditional/image_streams_of_namespace updated

* chore(docs): fix missing sample data

* chore(docs): clusterconfig/config_maps updated

* chore(docs): clusterconfig/recent_metrics updated

* chore(docs): explicit minor version

* chore(docs): clusterconfig/namespaces_with_overlapping_uids updated

* chore(docs): clusterconfig/openshift_sdn_controller_logs updated

* chore(docs): clusterconfig/openshift_sdn_controller_logs and gathered-data updated

* chore(docs): remove conditional data notes

* chore(docs): fix imagE_registries note about pv

* chore(docs): fix typo

* chore(docs): fix version for archive on image_pruners

* chore(docs): fix version for archive on ceph_cluster

* chore(docs): rename notes to changes

* chore(docs): fix wrong sample path for csr

* chore(docs): fix version for clusterconfig/container_images

* chore(docs): missing clusteroperator config id

* chore(docs): adjust location in archive

* chore(docs): fix config_maps bp version

* chore(docs): fix release version for clusterconfig/mutating_webhook_configurations

* chore(docs): updating bp version for clusterconfig/openshift_sdn_logs

* chore(docs): update bp versions for clusterconfig/pdbs

* chore(docs): fix bp version for clusterconfig/service_accounts

* chore(docs): fix clusterconfig/validating_webhook_configurations versions

* chore(docs): rephrase changes for clusterconfig/operators_pods_and_events

* Update docs/gathered-data.md

Co-authored-by: Jan Holeček <71874510+jholecek-rh@users.noreply.github.com>

* Update docs/gathered-data.md

Co-authored-by: Jan Holeček <71874510+jholecek-rh@users.noreply.github.com>

* Update docs/gathered-data.md

Co-authored-by: Jan Holeček <71874510+jholecek-rh@users.noreply.github.com>

* chore(docs): update based on review

* chore(docs): update gathered-data

* chore(docs): update clusterconfig/machine_configs versions

* chore(docs): update clusterconfig/operators_pods_and_events

* docs(chore): fix clusterconfig/version location in archive

* chore(docs): update clusterconfig/operators

* chore(docs): document should be data oriented to conditional gathering as well

* chore(docs): update code style

---------

Co-authored-by: Jan Holeček <71874510+jholecek-rh@users.noreply.github.com>

* OCPBUGS-6781: Create gatherer for gathering machines. (#725)

* Created gatherer for gathering machine objects.

* Fixing names of functions, variables, etc

* fixing file names

* Docs update with new gathered data and new sample data.

* formatted json files to human readable format

* documentation and code fixes

* Fixed location of sample files in docs

* Updated docs based on new format.

* tiny fix of go comment

* fixes

* unit test fixes

* lint fix

* unit test fixes

* OCPBUGS-6832: feat(recent_metrics) adds openshift_apps_deploymentconfigs_strategy_total (#726)

* feat(recent_metrics) adds openshift_apps_deploymentconfigs_strategy_total

* chore(docs): update gathered data

* fix(status/controller): fix status error for UnknownError

* OCPBUGS-6731: Anonymize env vars from containers: HTTP_PROXY, HTTPS_PROXY (#723)

* WIP draft overwriting env vars values

* Add unit test for env var obfuscation on container images gatherer

* Refactor obfuscate env vars functionality

* Fix obfusctation functionality and tests lint issues

* Move sensitive env vars obfuscation logic to anonymize utils package

* Add env vars obfuscation to pod recording

* Use assert library

* Add PR 723 Obfuscate HTTP_PROXY and HTTPS_PROXY

* Fix PR 723 type to bugfix

* Add unit tests to openshift sdn controller logs gatherer (#733)

* Rename sdn controller log gatherer file

* Refactor messagesfilter to open testing

* Add sdn controller logs gather unit tests

* Refactor SDNControllerLogs aux function name

* Update changelog #733 SDN controller log gatherer file renamed

* Refactor SDN controller logs unit tests

* Fix tests to work in parallel and minor refactor

* Fix lint complaining about loopclosure

* gather logs - update "FilterLogFromScanner" function and add some tests (#735)

* test(oauth): add unit test for oauth.go and rename it to gather_cluster_oauth.go  (#738)

* rename oauth.go and create unit tests for it

* lint fix

* refactoring

* test(clusterconfig): add unit test for ingresses.go and rename it to gather_cluster_ingress.go  (#729)

* chore(cluster_ingress): rename ingressess.go to gather_cluster_ingress.go

* test(clusteR_ingress): add missing unit test

* test(clusterconfig): add unit test for silenced_alerts.go and rename it to gather_silenced_alerts.go (#728)

* test(silenced_alerts): adding unit tests

* chore(clusterconfig): rename silenced_alerts.go to gather_silenced_alerts.go

* test(silenced_alerts): convert unit test to table-driven

* test(clusterconfig): review slienced_alerts tests

* test(clusterconfig): handle errs on gather_silenced_alerts_test.go

* Updating ose-insights-operator images to be consistent with ART (#748)

Reconciling with https://github.com/openshift/ocp-build-data/tree/e18d948b6ec9fc99c368102cffc1eea0c01f5765/images/ose-insights-operator.yml

Co-authored-by: AOS Automation Release Team <noreply@redhat.com>

* OCPBUGS-8082: service_accounts.go Marshal fix (#744)

* fixed code in service_accounts.go

* updated unit tests for service accounts gathering

* updated archive sample

* Updated code based on review

* updated code based on review and tremes input

* updated code and unit tests based on review

* OCPBUGS-7870: Collect info about monitoring pods pv (#741)

* DRAFT First approach to get PVs from openshift-monitoring namespace

* DRAFT unit tests trying to mockup PVs

* WIP Rework PV gatherer to allow unit tests, missing Doc yet

* WIP Rework PV Gatherer simple unit test

* Rename monitor PVs gatherer filename

* Rename unit tests for monitoring PVs gatherer

* Add monitoring PVs gatherer to clusterconfig

* Refactor adding possible errors track on getting persistent volumes

* Add sample file for Prometheus Persistent Volumes

* Rework unit tests to table format and Add two more tests

* Update changelog conflicts from rebase

* Rework monitoring pv gatherer checking configmaps

* Fix unit tests to new gather function

* Add new use case for not matching persistent volumes

* Add functions documentation and linting fixes

* Fix lint about variable names without underscore

* Fix monitoring persistent volume sample misleading name

* Fix context bad practice (inside struct) moved to parameter

* Fix missing removal of debug log printing

* Add new unit tests for monitoring gatherer private logic

* Refactor GatherMonitoringPVs logic to work with exact configuration data

* Update changelog and docs with new versioning

* Minor refactor to getDefaultPrometheusName tests

* Fix linting errors: too long lines

* Fixed unknown backport versions

* Refactor mock to an external file on testdata folder

* Refactor functions naming and doc to better suit logic

* Refactor context Background method

* Rework gatherer without ConfigMap search as redundant

* Fix linting

* update periodic_test.go & run unit tests with -race param (#745)

* Update docs & remove gathering of non-existing 'etcd_object_counts' m… (#743)

* Update docs & remove gathering of non-existing 'etcd_object_counts' metric

* reword backport versions

* test(clusterconfig): add unit test for active_alerts.go and rename it to gather_active_alerts.go  (#730)

* chore(clusterconfig): rename active_alerts.go to gather_active_alerts.go

* test(active_alerts): adding unit tests

* test(clusterconfig): add unit tests for cluster proxy gatherer (#756)

* Rename file to follow naming convention

* Add unit tests for cluster proxy gatherer

* Update changelog with last PR

* Fix linting

* Fix gocritic linter recommendations

* Fix revive linting recommendation

* test(clusterconfig): add unit test for nodes.go and rename it to gather_nodes.go (#731)

* chore(clusterconfig): rename nodes.go to gather_nodes.go

* test(nodes): add unit tests to gather

* test(gathere_nodes): fix assert

* test(clusterconfig): adjust gather_node_test context

* docs(gathered-data): adds anonymization info for gather_nodes

* docs(gathered-data): update gather_node docs

* test(clusterconfig): add unit test for version.go and rename it to gather_cluster_version.go (#732)

* chore(clusterconfig): rename version.go to gather_cluster_version.go

* test(clusterconfig): adds unit test for gather_cluster_version

* test(clusterconfig): reduce dups for gather_cluster_version_test

* changelog update (#760)

* changelog update

* deleted duplicate of #723

* update of latest hash

---------

Co-authored-by: Tomas Remes <tremes@users.noreply.github.com>
Co-authored-by: Ricardo Lüders <rluders@redhat.com>
Co-authored-by: Richard Hrmo <61187052+rhrmo@users.noreply.github.com>
Co-authored-by: OpenShift Bot <openshift-bot@redhat.com>
Co-authored-by: AOS Automation Release Team <noreply@redhat.com>
Co-authored-by: Deep Mistry <dmistry@redhat.com>
Co-authored-by: Jan Holeček <71874510+jholecek-rh@users.noreply.github.com>
Co-authored-by: Isaac Jimeno <isaacjim.dev@gmail.com>
Co-authored-by: Isaac Jimeno <ijimeno@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants