Skip to content

Commit

Permalink
release v0.9.1 (#8)
Browse files Browse the repository at this point in the history
* Adding command line flags (still need to cleanup some of the code)

* adds error message for missing pipe

* Adds unit test for the go side of the code

* adds go test in dockerfile

* some code refactoring and adds more test

* adds support for running go test in the CI docker file.

* adds a default to the groupSize flag

* adds test for groupSize

* some minor test updates

* more refactorings and updated test

* updated tests and added more tests

* adds shorthand flag for the title flag

* removed shortand tests

* moved the stdin checker into the main processing block

* updates to documentation and test

* added minor code-refactoring and fixing some broken test

* adds a short hand for the --groupSize flag

* adds AST parsing code to retrieve the filenames associated with test function names

* added initial code to map test names to their associated go test files.

* Adds the test file with line and col position information

* code cleanup

* added embedded assets into the binary

* updated dockerfile to fix broken build

* removed unnecessary generated code

* added verbose flag

* add total time at the end of process

* removed unneeded code

* updated readme

* adds a build script for mac, linux and windows builds

* updates release build file to create the destination folders before performing builds.

* added a little more clarity to the -groupSize usage description

* updates template to support change the html window title in addition to the title on the page

* updated readme and removed unneeded code

* nomenclature update

* added the embedded_assets.go file

* updates to the default test report template

* added the generate_embedded_go_code bash script

* moved some files around. preparing for commit to master

* moved assets to the root project folder and added test duration to the test report

* tweaked the test report template

* changes default groupSize from 10 to 20.

* small teak to the test report ui

* updated broken test

* added an ellipsis to test names that are to long

* updates the test report ui to show 'n/a' if a test was not found in the package

* Adds test execution date to test report html

* fixes date formatted problem in test execution date

* deleted jeykll file

* adds a unit test for the TestGenerateReport function

* test updates

* updated readme

* updates to readme file

* moved some things around in the readme file

* removed unneeded image in readme

* removing old files

* replacing shell scripts with makefile

* updated Dockerfile to use Makefile for builds

* updates to the readme file

* Removed support for 32bit version of windows binary

* changed default make command

* adds compresion support in the buildall target in Makefile

* added getPackageDetails as parameter to the generateReport function and updated associated test

* added test coverage for the parseSizeFlag function

* optimized the stringreader code in the getPackageDetails function.

* adds versioning

* added sha256 checksum files inside of the tar/zip files

* added note on gmake in readme

* editing change

* code cleanup based on golint

* simplified the generateTestReport function by breaking it up a bit

* added more test coverage

* updates to readme

* Bump lodash from 4.17.15 to 4.17.19 (#7)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Agesilas <samuelagesilas@Samuels-MacBook-Pro.local>

* adds .gitignore

* version bump to 0.9.1

* tidying the Makefile and adding the 'dockertest' command with updates to the Readme file.

* updated embedded assets

* adds newline to the coded generated in the embed_assets program

* added newline to Makefile

* injecting version at build time

* added version to ldflags in genbuild target

* updated Dockerfile and readme

* updating npm dependencies 🤦

* Better readability for test logs (#10)

* small fix to main and adds updated embedded assets

* updates dependency

* formatting

* updated contributers list

Co-authored-by: Samuel Agesilas <samuelagesilas@Samuels-MacBook-Pro.local>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dmitrii Misharov <quarckster@gmail.com>
  • Loading branch information
4 people authored Feb 15, 2021
1 parent dfcd9df commit 04fb431
Show file tree
Hide file tree
Showing 11 changed files with 1,035 additions and 912 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
go-test-report
go-test-report.exe
test_report.html
embed_assets/embed_assets
release_builds/
.idea/
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ RUN npm install
RUN npm fund
RUN npm run test

# Our Makefile version is GNU Make which alpine uses by default
RUN make genbuild
RUN go test -v
38 changes: 22 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
VERSION := $(file < version)
MACOS := go-test-report-darwin-$(VERSION)
LINUX := go-test-report-linux-$(VERSION)
WINDOWS := go-test-report-windows-$(VERSION)
MACOS := go-test-report-darwin-v$(VERSION)
LINUX := go-test-report-linux-v$(VERSION)
WINDOWS := go-test-report-windows-v$(VERSION)

LIN_DIR := release_builds/linux-amd64/
MAC_DIR := release_builds/darwin-amd64/
WIN_DIR := release_builds/windows-amd64/

genbuild: gencode
go build
go build -ldflags "-X main.version=$(VERSION)"

gencode:
(cd embed_assets/;set -e;go build;./embed_assets)

buildall: genbuild
echo "Building..."

mkdir -p release_builds/linux-amd64/
mkdir -p release_builds/darwin-amd64/
mkdir -p release_builds/windows-amd64/
mkdir -p $(LIN_DIR)
mkdir -p $(MAC_DIR)
mkdir -p $(WIN_DIR)

go mod verify

echo "Linux 64bit"
GOOS=linux GOARCH=amd64 go build -o release_builds/linux-amd64/
(cd release_builds/linux-amd64/; shasum -a 256 go-test-report | cut -d ' ' -f 1 > $(LINUX).sha256)
(cd release_builds/linux-amd64/; tar -czf $(LINUX).tgz go-test-report $(LINUX).sha256)
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o release_builds/linux-amd64/
(cd $(LIN_DIR); shasum -a 256 go-test-report | cut -d ' ' -f 1 > $(LINUX).sha256)
(cd $(LIN_DIR); tar -czf $(LINUX).tgz go-test-report $(LINUX).sha256)

echo "Darwin (MacOS) 64bit"
GOOS=darwin GOARCH=amd64 go build -o release_builds/darwin-amd64/
(cd release_builds/darwin-amd64/; shasum -a 256 go-test-report | cut -d ' ' -f 1 > $(MACOS).sha256)
(cd release_builds/darwin-amd64/; tar -czf $(MACOS).tgz go-test-report $(MACOS).sha256)
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o release_builds/darwin-amd64/
(cd $(MAC_DIR); shasum -a 256 go-test-report | cut -d ' ' -f 1 > $(MACOS).sha256)
(cd $(MAC_DIR); tar -czf $(MACOS).tgz go-test-report $(MACOS).sha256)

echo "Windows 64bit"
GOOS=windows GOARCH=amd64 go build -o release_builds/windows-amd64/
(cd release_builds/windows-amd64/; shasum -a 256 go-test-report.exe | cut -d ' ' -f 1 > $(WINDOWS).sha256)
(cd release_builds/windows-amd64/; zip -r $(WINDOWS).zip go-test-report.exe $(WINDOWS).sha256)
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o release_builds/windows-amd64/
(cd $(WIN_DIR); shasum -a 256 go-test-report.exe | cut -d ' ' -f 1 > $(WINDOWS).sha256)
(cd $(WIN_DIR); zip -r $(WINDOWS).zip go-test-report.exe $(WINDOWS).sha256)

echo "...Done!"

dockertest: genbuild
docker build . -t go-test-report-test-runner:$(VERSION)
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ $ go test -json | go-test-report -g 32x16

## Building from source

GNU make is used as the main build automation tool for go-test-report. MacOS users may need to upgrade their local `make` to the latest version using [homebrew](https://brew.sh/).
[GNU make](https://www.gnu.org/software/make/) is used as the main build automation tool for go-test-report. MacOS users may need to upgrade their local `make` to the latest version using [homebrew](https://brew.sh/).

```bash
$ brew install homebrew/core/make
Expand All @@ -158,6 +158,13 @@ $ gmake gencode
```
> Alternatively, `make genbuild` can be used which automatically runs `gencode` _before_ `genbuild`

To build the testing container _(This is the same docker image used during build automation)_:

```bash
$gmake dockertest
```

To build release binaries,

```bash
Expand All @@ -169,10 +176,14 @@ $ gmake buildall
> - `linux/amd64`
> - `windows/amd64`
## Contributors

[@quarckster](https://github.com/quarckster)


## Contribute & Support

- Add a GitHub Star
- Suggest [new features, ideas and optimizations](https://github.com/vakenbolt/go-test-report/issues)
- [Report issues](https://github.com/vakenbolt/go-test-report/issues)


2 changes: 1 addition & 1 deletion embed_assets/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ func main() {
_, _ = writer.WriteString(fmt.Sprintf("package main\n\nvar testReportHTMLTemplate = `%s`", string(dst)))
dst = make([]byte, hex.EncodedLen(len(jsCode)))
hex.Encode(dst, jsCode)
_, _ = writer.WriteString(fmt.Sprintf("\n\nvar testReportJsCode = `%s`", string(dst)))
_, _ = writer.WriteString(fmt.Sprintf("\n\nvar testReportJsCode = `%s`\n", string(dst)))
}
2 changes: 1 addition & 1 deletion embedded_assets.go

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"
)

var version = "0.9"
var version string // value gets injected at build time (see Makefile)

type (
goTestOutputRow struct {
Expand Down Expand Up @@ -203,7 +203,6 @@ func readTestDataFromStdIn(stdinScanner *bufio.Scanner, flags *cmdFlags, cmd *co

// read from stdin and parse "go test" results
for stdinScanner.Scan() {
stdinScanner.Text()
lineInput := stdinScanner.Bytes()
if flags.verbose {
newline := []byte("\n")
Expand Down
Loading

0 comments on commit 04fb431

Please sign in to comment.