• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / inventory / 921200914

pending completion
921200914

Pull #396

gitlab-ci

merlin-northern
chore: additional unit tests.

Ticket: MEN-6425
Signed-off-by: Peter Grzybowski <peter@northern.tech>
Pull Request #396: feat: update inventory only when changed or outdated.

89 of 128 new or added lines in 3 files covered. (69.53%)

65 existing lines in 2 files now uncovered.

3181 of 3504 relevant lines covered (90.78%)

139.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/utils/time.go
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
package utils
16

17
import "time"
18

19
func TruncateToDay(t time.Time) time.Time {
13✔
20
        return time.Date(
13✔
21
                t.Year(),
13✔
22
                t.Month(),
13✔
23
                t.Day(),
13✔
24
                0,
13✔
25
                0,
13✔
26
                0,
13✔
27
                0,
13✔
28
                t.Location(),
13✔
29
        )
13✔
30
}
13✔
31

NEW
32
func TruncateToSeconds(t time.Time) time.Time {
×
NEW
33
        return time.Date(
×
NEW
34
                t.Year(),
×
NEW
35
                t.Month(),
×
NEW
36
                t.Day(),
×
NEW
37
                t.Hour(),
×
NEW
38
                t.Minute(),
×
NEW
39
                t.Second(),
×
NEW
40
                0,
×
NEW
41
                t.Location(),
×
NEW
42
        )
×
NEW
43
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc