@@ -90,18 +90,18 @@ func TestRunner(t *testing.T) {
9090
9191 // Check Schema
9292 code , output , err := tc .Exec (ctx , []string {"sudo" , "/opt/splunk/bin/splunk" , "btool" , "check" , "--debug" })
93- assert .NoError (t , err )
93+ require .NoError (t , err )
9494 assert .LessOrEqual (t , code , 1 ) // Other stanzas may be missing and thus have this be 0 or 1
9595 assert .GreaterOrEqual (t , code , 0 ) // bound to [0,1]
9696 read , err := io .ReadAll (output )
97- assert .NoError (t , err )
97+ require .NoError (t , err )
9898 assert .NotContains (t , string (read ), "Invalid Key in Stanza" )
9999
100100 // check log output
101101 _ , output , err = tc .Exec (ctx , []string {"sudo" , "cat" , "/opt/splunk/var/log/splunk/Sample_Addon.log" })
102102 require .NoError (t , err )
103103 read , err = io .ReadAll (output )
104- assert .NoError (t , err )
104+ require .NoError (t , err )
105105 expectedJSON := `{"Flags":["--test-flag","/opt/splunk/etc/apps/Sample_Addon/local/access_token","--test-flag"],"EnvVars":["EVERYTHING_SET=/opt/splunk/etc/apps/Sample_Addon/local/access_token","UNARY_FLAG_WITH_EVERYTHING_SET=/opt/splunk/etc/apps/Sample_Addon/local/access_token"], "SplunkHome":"/opt/splunk/etc", "TaHome":"/opt/splunk/etc/apps/Sample_Addon", "PlatformHome":"/opt/splunk/etc/apps/Sample_Addon/linux_x86_64", "EverythingSet":"/opt/splunk/etc/apps/Sample_Addon/local/access_token", "MinimalSet":"", "MinimalSetRequired":"", "UnaryFlagWithEverythingSet":"/opt/splunk/etc/apps/Sample_Addon/local/access_token","Platform":"linux"}`
106106 i := bytes .Index (read , []byte ("Sample output:" ))
107107 line := read [i + len ("Sample output:" ):]
@@ -112,7 +112,7 @@ func TestRunner(t *testing.T) {
112112 require .NoError (t , dec .Decode (unmarshalled ))
113113 expected := & ExampleOutput {}
114114 require .NoError (t , json .Unmarshal ([]byte (expectedJSON ), expected ))
115- assert .EqualValues (t , expected , unmarshalled )
115+ assert .Equal (t , expected , unmarshalled )
116116}
117117
118118func TestRunnerConfigGeneration (t * testing.T ) {
@@ -135,9 +135,9 @@ func TestRunnerConfigGeneration(t *testing.T) {
135135 for _ , tc := range tests {
136136 t .Run (tc .testSchemaName , func (tt * testing.T ) {
137137 config , err := loadYaml (tc .sampleYamlPath , tc .testSchemaName )
138- assert .NoError (tt , err )
138+ require .NoError (tt , err )
139139 err = generateModinputConfig (config , tc .outDir )
140- assert .NoError (tt , err )
140+ require .NoError (tt , err )
141141 assert .FileExists (tt , filepath .Join (filepath .Dir (tc .sampleYamlPath ), "modinput_config.go" ))
142142 })
143143 }
@@ -166,9 +166,9 @@ func TestInputsConfGeneration(t *testing.T) {
166166 for _ , tc := range tests {
167167 t .Run (tc .testSchemaName , func (tt * testing.T ) {
168168 config , err := loadYaml (tc .sampleYamlPath , tc .testSchemaName )
169- assert .NoError (tt , err )
169+ require .NoError (tt , err )
170170 err = generateTaModInputConfs (config , tc .addonSourceDir , tc .outDir )
171- assert .NoError (tt , err )
171+ require .NoError (tt , err )
172172 testcommon .AssertFilesMatch (tt , filepath .Join ("internal" , "testdata" , "pkg" , "sample_addon" , "expected" , "inputs.conf" ), filepath .Join (tc .outDir , tc .testSchemaName , "default" , "inputs.conf" ))
173173 testcommon .AssertFilesMatch (tt , filepath .Join ("internal" , "testdata" , "pkg" , "sample_addon" , "expected" , "inputs.conf.spec" ), filepath .Join (tc .outDir , tc .testSchemaName , "README" , "inputs.conf.spec" ))
174174 })
0 commit comments