Skip to content

Commit 76b272d

Browse files
committed
chore: cleanup files
1 parent 31e1093 commit 76b272d

9 files changed

Lines changed: 13 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Install libpcap-dev
10-
run: sudo apt update && sudo apt install -y libpcap-dev
119
- uses: actions/checkout@v4
1210
with:
1311
fetch-depth: 0

.github/workflows/pr.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Install libpcap-dev
10-
run: sudo apt update && sudo apt install -y libpcap-dev
119
- uses: actions/checkout@v4
1210
with:
1311
fetch-depth: 0

Dockerfile.testing

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM nginx
33
WORKDIR /app
44

5-
RUN apt update && apt install -y ca-certificates wget jq moreutils htop procps nano net-tools gcc make libpcap-dev openjdk-17-jdk ant netcat-traditional
5+
RUN apt update && apt install -y ca-certificates wget jq moreutils htop procps nano net-tools gcc make openjdk-17-jdk ant netcat-traditional
66

77

88
RUN wget https://go.dev/dl/go1.21.6.linux-$(dpkg --print-architecture).tar.gz -O go.tar.gz

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ build: ## Build Daemon
66
CGO_ENABLED=0 go build -ldflags "-X github.com/highcard-dev/daemon/internal.Version=$(VERSION)" -o ./bin/druid
77

88
build-x86-docker:
9-
docker build . -f build/Dockerfile.darwin -t golang-new-builder:latest
10-
docker run -e GOOS=linux -e GOARCH=amd64 -it --rm -v ./:/app -w /app --entrypoint=/bin/bash golang-new-builder:latest -c 'CGO_ENABLED=1 go build -ldflags "-X github.com/highcard-dev/daemon/internal.Version=$(VERSION)" -o ./bin/x86/druid'
9+
docker run -e GOOS=linux -e GOARCH=amd64 -it --rm -v ./:/app -w /app --entrypoint=/bin/bash docker.elastic.co/beats-dev/golang-crossbuild:1.22.5-main -c 'CGO_ENABLED=1 go build -ldflags "-X github.com/highcard-dev/daemon/internal.Version=$(VERSION)" -o ./bin/x86/druid'
1110

1211
install: ## Install Daemon
1312
cp ./bin/druid /usr/local/bin/druid

build/Dockerfile.darwin

Lines changed: 0 additions & 3 deletions
This file was deleted.

cmd/serve.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ to interact and monitor the Scroll Application`,
151151
go func() {
152152
if useColdstarter {
153153
if currentScroll.CanColdStart() {
154+
logger.Log().Info("Starting coldstarter")
154155
err = coldStarter.StartOnce(ctx)
155156
if err != nil {
156157
logger.Log().Error("Error in coldstarter", zap.Error(err))
@@ -286,7 +287,7 @@ func init() {
286287
ServeCommand.Flags().StringArrayVarP(&watchPortsInterfaces, "watch-ports-interfaces", "", []string{"lo"}, "Interfaces to watch for port activity")
287288
}
288289

289-
ServeCommand.Flags().BoolVarP(&useColdstarter, "coldstarter", "", true, "Use coldstarter to not start immediately")
290+
ServeCommand.Flags().BoolVarP(&useColdstarter, "coldstarter", "", false, "Use coldstarter to not start immediately")
290291

291292
ServeCommand.Flags().BoolVarP(&ignoreVersionCheck, "ignore-version-check", "", false, "Ignore version check")
292293

internal/core/services/port_service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ func (p *PortMonitor) SyncPortEnv(file *domain.File) []*domain.AugmentedPort {
7070
}
7171

7272
ap := &domain.AugmentedPort{
73-
Port: port,
73+
Port: port,
74+
InactiveSince: time.Now(),
7475
}
7576

7677
augmentedPorts[idx] = ap

test/integration/commands/serve_coldstarter_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,20 @@ var setupScroll = func(t *testing.T, scroll domain.File) (string, string) {
157157

158158
var setupServeCmd = func(ctx context.Context, t *testing.T, cwd string, additionalArgs []string) {
159159

160+
args := append([]string{"--cwd", cwd, "serve"}, additionalArgs...)
161+
160162
b := bytes.NewBufferString("")
161163

162164
serveCmd := cmd.RootCmd
163165
serveCmd.SetErr(b)
164166
serveCmd.SetOut(b)
165-
serveCmd.SetArgs(append([]string{"--cwd", cwd, "serve"}, additionalArgs...))
166-
167+
serveCmd.SetArgs(args)
167168
// Create a new context for each test case
168169

169170
cmd.ServeCommand.SetContext(ctx)
170171

172+
logger.Log().Info(fmt.Sprintf("Running serve command with args: %v", args))
173+
171174
connected, err := startAndTestServeCommand(ctx, t, serveCmd)
172175
if !connected {
173176
t.Fatalf("Failed to connect to daemon web server: %v", err)
@@ -306,7 +309,7 @@ func TestColdstarterServeCommand(t *testing.T) {
306309
ctx, cancel := context.WithCancelCause(context.Background())
307310
defer cancel(errors.New("test ended"))
308311

309-
setupServeCmd(ctx, t, path, []string{})
312+
setupServeCmd(ctx, t, path, []string{"--coldstarter"})
310313

311314
defer func() {
312315
signals.Stop()

test/integration/commands/serve_watch_ports_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func TestWatchPortsServeCommand(t *testing.T) {
7272
ctx, cancel := context.WithCancelCause(context.Background())
7373
defer cancel(errors.New("test ended"))
7474

75-
setupServeCmd(ctx, t, path, []string{"--watch-ports"})
75+
setupServeCmd(ctx, t, path, []string{"--watch-ports", "--coldstarter=false"})
7676

7777
defer func() {
7878
signals.Stop()

0 commit comments

Comments
 (0)