Skip to content

Commit

Permalink
adapters/ix: save/restore global var in test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitris committed Apr 24, 2024
1 parent ca83a83 commit ba571a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adapters/ix/ix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ func TestBuildIxDiag(t *testing.T) {

for _, test := range testCases {
t.Run(test.description, func(t *testing.T) {
// save and later restore the value of the global variable to avoid side-effecting other tests
oldVersionVer := version.Ver
defer func() { version.Ver = oldVersionVer }()
version.Ver = test.pbsVersion
ixDiag := &IxDiag{}
err := setIxDiagIntoExtRequest(test.request, ixDiag)
Expand Down

0 comments on commit ba571a3

Please sign in to comment.