Skip to content

Commit

Permalink
[#674] Prepare test cases for introspective variant
Browse files Browse the repository at this point in the history
- add test placeholder for param variant value checking
- add test placeholder for introspective variant execution by engine
  • Loading branch information
mengdaming committed Oct 1, 2024
1 parent e143784 commit 6bebc08
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
46 changes: 46 additions & 0 deletions src/config/param_variant_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright (c) 2024 Murex
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

package config

import "testing"

func Test_valid_variant_values(t *testing.T) {
t.Skip("work in progress")
tests := []struct {
input string
expectedValue string
expectedError error
}{
{
input: "relaxed",
expectedValue: "relaxed",
expectedError: nil,
},
}

for _, test := range tests {
t.Run(test.input, func(t *testing.T) {
// TODO
})
}
}
18 changes: 17 additions & 1 deletion src/engine/tcr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func Test_relaxed_doesnt_revert_test_files(t *testing.T) {
assert.NotEqual(t, fake.RestoreCommand, vcsFake.GetLastCommand())
}

func Test_relaxed_reverts(t *testing.T) {
func Test_variant_specific_reverts(t *testing.T) {
testFlags := []struct {
description string
variant variant.Variant
Expand Down Expand Up @@ -360,6 +360,22 @@ func Test_relaxed_reverts(t *testing.T) {
}
}

func Test_introspective_variant(t *testing.T) {
t.Skip("work in progress")
tcr, vcsFake := initTCREngineWithFakesWithFileDiffs(
params.AParamSet(params.WithVariant(variant.Introspective)),
nil, nil, nil, vcs.FileDiffs{
vcs.NewFileDiff("fake-src", 1, 1),
vcs.NewFileDiff("fake-test", 1, 1),
})

tcr.revert(*events.ATcrEvent())
//sniffer.Stop()
assert.Equal(t, fake.RestoreCommand, vcsFake.GetLastCommand())
//assert.Equal(t, 1, sniffer.GetMatchCount())

}

func Test_tcr_cycle_end_state(t *testing.T) {
testFlags := []struct {
desc string
Expand Down

0 comments on commit 6bebc08

Please sign in to comment.