-
Notifications
You must be signed in to change notification settings - Fork 29
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
Dogfood e2etest; Client/Server Application #617
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
dogfood/README.md
Outdated
|
||
For the purposes of testing disruptions/workflows, you should make sure that the datadog agent is properly installed | ||
on the cluster that the client and server are running on. 3 of the major disruptive resources properly send metrics | ||
to Datadog (CPU, Network, Disk). The client contains computation related to these disruptions and can be tested using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 of the major disruptive resources properly send metrics to Datadog (CPU, Network, Disk).
I dont understand this sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing, let me know if its still confusing after the next commit
.
func printAndLog(logLine string) { | ||
fmt.Println(logLine) | ||
|
||
go func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, why do we want to write all this random data to /mnt/data/logging whenever we're trying to print to console? They dont seem to need to be so coupled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of printAndLog is to give the client Write IO. This is the function that will help us test Disk write disruptions properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know why we want to have the logging done, but why put it in printAndLog? It seems this could be in gothreads that run separately, I don't see why we kick it off once per print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this spawned from not knowing what data to write to disk at first. I think you can pull random data from somewhere, but I opted to just use the logs that were already in the code as data to write.
labels: {} | ||
type: Opaque | ||
data: | ||
api-key: PUT_YOUR_BASE64_ENCODED_API_KEY_HERE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the two user input lines, is this all copied from elsewhere? Any chance we could directly import that file, and use a values.yaml for api-key and token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it also seems like we'd want to put a private api key in a gitignored file for safety?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is mostly for others who need a datadog agent deploy. Its not something we will couple with our deploy considering the datadog agent is already deployed on our clusters.
dogfood/tester/disruptions.go
Outdated
Network: &v1beta1.NetworkDisruptionSpec{ | ||
Hosts: []v1beta1.NetworkDisruptionHostSpec{ | ||
{ | ||
Host: "chaos-dogfood-server.chaos-demo.svc.cluster.local", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is re-used, could we extract it to a const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could also extract more of the disruption spec parameters into their own variables / const, as it seems we're re-using most of it (object meta namespace, spec counts, unsafemode, duration, whole hosts). What do you think?
dogfood/tester/disruptions.go
Outdated
// Globals | ||
|
||
var SELECTOR = []string{"app", "chaos-dogfood-client"} | ||
var CONTAINER = "client-deploy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be consts, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think you can make string arrays const? but I can make the others.
Note: we're keeping the PR open for now, we'll re-adapt it based on recent changes made to e2e tests plan once possible. |
What does this PR do?
Please briefly describe your changes as well as the motivation behind them:
First iteration of a larger project to create regression-like testing for the chaos controller. The PR contains an updated dogfood which has been tweaked slightly to confirm that the metrics we need to test CPU, Network, and Disk are present in Datadog.
The tester folder is present in this PR to show the current path that will be taken with this project and is by no means done or being used in any capacity.
Code Quality Checklist
Testing
unit
tests orend-to-end
tests.unit
tests orend-to-end
tests.