Skip to content

Commit

Permalink
PR feedback & add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aphralG committed May 2, 2024
1 parent 2515bfb commit 9ede22b
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 10 deletions.
8 changes: 7 additions & 1 deletion internal/datasource/host/process_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
// Copyright (c) F5, Inc.
//
// This source code is licensed under the Apache License, Version 2.0 license found in the
// LICENSE file in the root directory of this source tree.

package host

import (
"testing"

"github.com/nginx/agent/v3/internal/model"
"github.com/stretchr/testify/assert"
"testing"
)

func TestProcess_GetNginxProcesses(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/plugin/process_monitor_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ package plugin

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"testing"
"time"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/stretchr/testify/require"

"github.com/nginx/agent/v3/internal/bus"
Expand Down
3 changes: 2 additions & 1 deletion internal/plugin/resource_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ package plugin

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"log/slog"
"sync"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
"github.com/nginx/agent/v3/internal/bus"
"github.com/nginx/agent/v3/internal/config"
Expand Down
3 changes: 2 additions & 1 deletion internal/plugin/resource_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ package plugin

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"testing"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
"github.com/nginx/agent/v3/internal/bus"
"github.com/nginx/agent/v3/internal/model"
Expand Down
3 changes: 2 additions & 1 deletion internal/service/instance/agent_instance_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ package instance

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"log/slog"
"os"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
"github.com/nginx/agent/v3/internal/config"
"google.golang.org/protobuf/types/known/structpb"
Expand Down
3 changes: 2 additions & 1 deletion internal/service/instance/agent_instance_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ package instance

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"testing"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/test/types"
"github.com/stretchr/testify/assert"
)
Expand Down
1 change: 1 addition & 0 deletions internal/service/instance/data_plane_instance_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package instance

import (
"context"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
Expand Down
3 changes: 2 additions & 1 deletion internal/service/instance/nginx_instance_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
"bytes"
"context"
"fmt"
"github.com/nginx/agent/v3/internal/datasource/host"
"log/slog"
"os"
"path"
"regexp"
"strings"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
"github.com/nginx/agent/v3/internal/datasource/host/exec"
process "github.com/nginx/agent/v3/internal/datasource/nginx"
Expand Down
3 changes: 2 additions & 1 deletion internal/service/instance/nginx_instance_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"bytes"
"context"
"fmt"
"github.com/nginx/agent/v3/internal/datasource/host"
"path/filepath"
"sort"
"strings"
"testing"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/test/helpers"

"github.com/stretchr/testify/require"
Expand Down
3 changes: 2 additions & 1 deletion internal/service/instance_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ package service

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"sync"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
"github.com/nginx/agent/v3/internal/config"
"github.com/nginx/agent/v3/internal/service/instance"
Expand Down
3 changes: 2 additions & 1 deletion internal/service/instance_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ package service

import (
"context"
"github.com/nginx/agent/v3/internal/datasource/host"
"testing"

"github.com/nginx/agent/v3/internal/datasource/host"

"github.com/nginx/agent/v3/api/grpc/mpi/v1"
"github.com/nginx/agent/v3/test/protos"
"github.com/nginx/agent/v3/test/types"
Expand Down

0 comments on commit 9ede22b

Please sign in to comment.