-
Notifications
You must be signed in to change notification settings - Fork 887
chore: add agentapi tests #11269
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: add agentapi tests #11269
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @deansheather and the rest of your teammates on |
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 didn't finish this review, but I'm sending the comments I have since you're in a different timezone
}, | ||
} | ||
} | ||
) |
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 wonder if we should break the manifest up into separate API calls. It's kind of a dumping ground for lots of different, unrelated kinds of information...
Not that I'm expecting it in this PR.
now, err := time.Parse("2006-01-02 15:04:05 -0700 MST", "2023-12-19 07:30:00 +1100 AEDT") | ||
require.NoError(t, err) | ||
now = dbtime.Time(now) | ||
nextAutostart := now.Add(30 * time.Minute).UTC() // always sent to DB as UTC |
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.
to me, this smells like we need to refactor. The AgentAPI should not be in the business of computing autostart times. There should be a scheduler component that gets an activity indication from the Agent API and it computes and decides how to update the autostart / autostop schedule.
Another one for some other PR...
The tests added in this PR can be reviewed now as I probably won't be changing them (other than review comments). I'll be adding more tests for the files TODOd below in upcoming commits and I'll re-request review.In most cases the new tests have more cases/coverage than the old ones which is nice. Some of them are quite verbose though, as I tried to maximize usage of fields on types and enums (to get conversion coverage).
TODOs:
metadata.go
stats.go
tailnet.go