Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit db0930c

Browse files
committed
Add an extra mocking test for what happens if running under windows where no signals are supported.
Revert this commit when we have actual CI tests running under windows. Signed-off-by: Ying Li <ying.li@docker.com>
1 parent 89acf3b commit db0930c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

utils/configuration_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func TestAdjustLogLevel(t *testing.T) {
536536
}
537537
}
538538

539-
func TestSetSignalTrap(t *testing.T) {
539+
func testSetSignalTrap(t *testing.T) {
540540
var signalsPassedOn map[string]struct{}
541541

542542
signalHandler := func(s os.Signal) {
@@ -560,3 +560,16 @@ func TestSetSignalTrap(t *testing.T) {
560560
require.NotNil(t, signalsPassedOn[s.String()])
561561
}
562562
}
563+
564+
// TODO: undo this extra indirection, needed for mocking notary.NotarySupportedSignals being empty, when we have
565+
// a windows CI system running
566+
func TestSetSignalTrap(t *testing.T) {
567+
testSetSignalTrap(t)
568+
}
569+
570+
func TestSetSignalTrapMockWindows(t *testing.T) {
571+
old := notary.NotarySupportedSignals
572+
notary.NotarySupportedSignals = nil
573+
testSetSignalTrap(t)
574+
notary.NotarySupportedSignals = old
575+
}

0 commit comments

Comments
 (0)