File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
tools/cli/internal/cli/split Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,26 @@ func TestSplitMulitplePreviewsRun(t *testing.T) {
115115 require .Contains (t , info .Spec .Paths .Map (), "/api/atlas/v2/groups/{groupId}/serviceAccounts" )
116116}
117117
118+ func TestInjectSha_Run (t * testing.T ) {
119+ fs := afero .NewMemMapFs ()
120+ opts := & Opts {
121+ basePath : "../../../test/data/base_spec.json" ,
122+ outputPath : "foas.yaml" ,
123+ fs : fs ,
124+ gitSha : "123456" ,
125+ }
126+
127+ if err := opts .Run (); err != nil {
128+ t .Fatalf ("Run() unexpected error: %v" , err )
129+ }
130+
131+ result , err := loadRunResultOas (fs , "foas-2023-01-01.yaml" )
132+ require .NoError (t , err )
133+ // check sha
134+ require .Contains (t , result .Spec .Info .Extensions , "x-xgen-sha" )
135+ require .Equal (t , "123456" , result .Spec .Info .Extensions ["x-xgen-sha" ])
136+ }
137+
118138func TestOpts_PreRunE (t * testing.T ) {
119139 testCases := []struct {
120140 wantErr require.ErrorAssertionFunc
You can’t perform that action at this time.
0 commit comments