Fixed created_at timestamp for install results. (#22093)

Unreleased bug #22091 
# Checklist for submitter

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
This commit is contained in:
Victor Lyuboslavsky 2024-09-13 16:29:51 -05:00 committed by GitHub
parent 2d78943b05
commit 394caa0138
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -438,6 +438,7 @@ SELECT
hsi.install_script_exit_code,
hsi.self_service,
hsi.host_deleted_at,
hsi.created_at as created_at,
si.user_id AS software_installer_user_id,
si.user_name AS software_installer_user_name,
si.user_email AS software_installer_user_email

View file

@ -11757,6 +11757,7 @@ func (s *integrationEnterpriseTestSuite) TestHostSoftwareInstallResult() {
}
// create some install requests for the host
beforeInstall := time.Now()
installUUIDs := make([]string, 3)
titleIDs := []uint{titleID, titleID2, titleID3}
for i := 0; i < len(installUUIDs); i++ {
@ -11783,6 +11784,8 @@ func (s *integrationEnterpriseTestSuite) TestHostSoftwareInstallResult() {
assert.Equal(t, want.PreInstallQueryOutput, resp.Results.PreInstallQueryOutput)
assert.Equal(t, want.Output, resp.Results.Output)
assert.Equal(t, want.PostInstallScriptOutput, resp.Results.PostInstallScriptOutput)
assert.Less(t, beforeInstall, resp.Results.CreatedAt)
assert.Greater(t, time.Now(), resp.Results.CreatedAt)
}
s.Do("POST", "/api/fleet/orbit/software_install/result",