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

[tests] Add support for resources.ExternalResources #3811

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

nbroyles
Copy link
Collaborator

@nbroyles nbroyles commented Oct 4, 2021

This commit adds an interface for adding external (i.e. not M3)
resources that can be used in integration tests. An
implementation of the interface that allows users to spin up
a docker-backed Prometheus is added as well. This also functions
as a working example for how the interface can be implemented to
support other external resources.

What this PR does / why we need it:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@nbroyles nbroyles requested a review from fishie9 October 4, 2021 17:35
@nbroyles nbroyles force-pushed the nb/external-resources branch 2 times, most recently from 1630bf0 to 10bd583 Compare October 4, 2021 17:37
return err
}

p.resource = nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to explicitly nil this out? Also do we need synchronization on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a safety thing. If the resource is nil, we know that we've cleaned up properly or haven't started a previous run. The Setup method explicitly checks for this.

Also, no synchronization should be needed here. There shouldn't be any concurrency on the same instance of a prometheus object.

Copy link
Collaborator

@wesleyk wesleyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This commit adds an interface for adding external (i.e. not M3)
resources that can be used in integration tests. An
implementation of the interface that allows users to spin up
a docker-backed Prometheus is added as well. This also functions
as a working example for how the interface can be implemented to
support other external resources.
@nbroyles nbroyles force-pushed the nb/external-resources branch from 10bd583 to 06fa74a Compare October 4, 2021 17:48
@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #3811 (06fa74a) into master (4a4559d) will decrease coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #3811     +/-   ##
========================================
- Coverage    56.8%   56.8%   -0.1%     
========================================
  Files         552     552             
  Lines       63079   63079             
========================================
- Hits        35876   35834     -42     
- Misses      24004   24038     +34     
- Partials     3199    3207      +8     
Flag Coverage Δ
aggregator 63.3% <ø> (ø)
cluster ∅ <ø> (∅)
collector 58.4% <ø> (ø)
dbnode 60.4% <ø> (-0.1%) ⬇️
m3em 46.4% <ø> (ø)
metrics 19.7% <ø> (ø)
msg 74.2% <ø> (-0.2%) ⬇️

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


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a4559d...06fa74a. Read the comment docs.

@nbroyles nbroyles merged commit 0f671c9 into master Oct 4, 2021
@nbroyles nbroyles deleted the nb/external-resources branch October 4, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants