Makefile: test

This commit is contained in:
Sam Hoffman
2026-01-30 17:39:38 -05:00
parent 18b5ad4ff6
commit 93c538b470
2 changed files with 14 additions and 2 deletions

View File

@@ -3,9 +3,12 @@ VERSION=$(shell git describe --tags --always)
BUILD_TIME=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) BUILD_TIME=$(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME}" LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME}"
.PHONY: all .PHONY: all test
all: build-linux all: build-linux
test:
go test ./...
build-linux: build-linux:
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/thanks ./cmd/thanks GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/thanks ./cmd/thanks

View File

@@ -1,3 +1,6 @@
// Package jobs provides definitions and features for Backup Jobs themselves.
// [BackupJob] is the primary resource here.
// [BackupJob.Do] is the main entrypoint for running through the backup process.
package jobs package jobs
import ( import (
@@ -94,7 +97,13 @@ func (j *BackupJob) Snapshot(ctx context.Context) (string, error) {
} }
func (j *BackupJob) FullSend(ctx context.Context, snap string) { func (j *BackupJob) FullSend(ctx context.Context, snap string) {
out, err := zfs.Cmd(ctx, "zfs send -Lec %s | ssh %s zfs recv -Fu %s", snap, j.TargetHost, j.Target) out, err := zfs.Cmd(
ctx,
"zfs send -Lec %s | ssh %s zfs recv -Fu %s",
snap,
j.TargetHost,
j.Target,
)
if err != nil { if err != nil {
log.Fatalf("zfs-send: error: %s", out) log.Fatalf("zfs-send: error: %s", out)
} }