github.com/gohugoio/hugo@v0.88.1/releaser/releasenotes_writer_test.go (about) 1 // Copyright 2017-present The Hugo Authors. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 // Package commands defines and implements command-line commands and flags 15 // used by Hugo. Commands and flags are implemented using Cobra. 16 17 package releaser 18 19 import ( 20 "bytes" 21 "fmt" 22 "os" 23 "testing" 24 25 qt "github.com/frankban/quicktest" 26 ) 27 28 func _TestReleaseNotesWriter(t *testing.T) { 29 if os.Getenv("CI") != "" { 30 // Travis has an ancient git with no --invert-grep: https://github.com/travis-ci/travis-ci/issues/6328 31 t.Skip("Skip git test on CI to make Travis happy.") 32 } 33 c := qt.New(t) 34 35 var b bytes.Buffer 36 37 // TODO(bep) consider to query GitHub directly for the gitlog with author info, probably faster. 38 infos, err := getGitInfosBefore("HEAD", "v0.20", "hugo", "", false) 39 c.Assert(err, qt.IsNil) 40 41 c.Assert(writeReleaseNotes("0.21", infos, infos, &b), qt.IsNil) 42 43 fmt.Println(b.String()) 44 }