Skip to content

Commit

Permalink
chore: cleanup files
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcStdt committed Sep 1, 2024
1 parent 31e1093 commit 76b272d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install libpcap-dev
run: sudo apt update && sudo apt install -y libpcap-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install libpcap-dev
run: sudo apt update && sudo apt install -y libpcap-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.testing
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM nginx
WORKDIR /app

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
RUN apt update && apt install -y ca-certificates wget jq moreutils htop procps nano net-tools gcc make openjdk-17-jdk ant netcat-traditional


RUN wget https://go.dev/dl/go1.21.6.linux-$(dpkg --print-architecture).tar.gz -O go.tar.gz
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ build: ## Build Daemon
CGO_ENABLED=0 go build -ldflags "-X github.com/highcard-dev/daemon/internal.Version=$(VERSION)" -o ./bin/druid

build-x86-docker:
docker build . -f build/Dockerfile.darwin -t golang-new-builder:latest
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'
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'

install: ## Install Daemon
cp ./bin/druid /usr/local/bin/druid
Expand Down
3 changes: 0 additions & 3 deletions build/Dockerfile.darwin

This file was deleted.

3 changes: 2 additions & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ to interact and monitor the Scroll Application`,
go func() {
if useColdstarter {
if currentScroll.CanColdStart() {
logger.Log().Info("Starting coldstarter")
err = coldStarter.StartOnce(ctx)
if err != nil {
logger.Log().Error("Error in coldstarter", zap.Error(err))
Expand Down Expand Up @@ -286,7 +287,7 @@ func init() {
ServeCommand.Flags().StringArrayVarP(&watchPortsInterfaces, "watch-ports-interfaces", "", []string{"lo"}, "Interfaces to watch for port activity")
}

ServeCommand.Flags().BoolVarP(&useColdstarter, "coldstarter", "", true, "Use coldstarter to not start immediately")
ServeCommand.Flags().BoolVarP(&useColdstarter, "coldstarter", "", false, "Use coldstarter to not start immediately")

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

Expand Down
3 changes: 2 additions & 1 deletion internal/core/services/port_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func (p *PortMonitor) SyncPortEnv(file *domain.File) []*domain.AugmentedPort {
}

ap := &domain.AugmentedPort{
Port: port,
Port: port,
InactiveSince: time.Now(),
}

augmentedPorts[idx] = ap
Expand Down
9 changes: 6 additions & 3 deletions test/integration/commands/serve_coldstarter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,20 @@ var setupScroll = func(t *testing.T, scroll domain.File) (string, string) {

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

args := append([]string{"--cwd", cwd, "serve"}, additionalArgs...)

b := bytes.NewBufferString("")

serveCmd := cmd.RootCmd
serveCmd.SetErr(b)
serveCmd.SetOut(b)
serveCmd.SetArgs(append([]string{"--cwd", cwd, "serve"}, additionalArgs...))

serveCmd.SetArgs(args)
// Create a new context for each test case

cmd.ServeCommand.SetContext(ctx)

logger.Log().Info(fmt.Sprintf("Running serve command with args: %v", args))

connected, err := startAndTestServeCommand(ctx, t, serveCmd)
if !connected {
t.Fatalf("Failed to connect to daemon web server: %v", err)
Expand Down Expand Up @@ -306,7 +309,7 @@ func TestColdstarterServeCommand(t *testing.T) {
ctx, cancel := context.WithCancelCause(context.Background())
defer cancel(errors.New("test ended"))

setupServeCmd(ctx, t, path, []string{})
setupServeCmd(ctx, t, path, []string{"--coldstarter"})

defer func() {
signals.Stop()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/commands/serve_watch_ports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestWatchPortsServeCommand(t *testing.T) {
ctx, cancel := context.WithCancelCause(context.Background())
defer cancel(errors.New("test ended"))

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

defer func() {
signals.Stop()
Expand Down

0 comments on commit 76b272d

Please sign in to comment.