Skip to content

Commit

Permalink
update: README
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Apr 16, 2023
1 parent a33a5fd commit cf062f9
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 190 deletions.
231 changes: 53 additions & 178 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/nebula/cmd_crawl.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ var CrawlCommand = &cli.Command{
},
&cli.StringFlag{
Name: "json-out",
Usage: "If set, stores the crawl results as JSON documents at the specified location (takes precedence over database settings).",
Usage: "If set, stores the crawl results as JSON documents at `DIR` (takes precedence over database settings).",
EnvVars: []string{"NEBULA_CRAWL_JSON_OUT"},
Value: crawlConfig.JSONOut,
Destination: &crawlConfig.JSONOut,
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/crawl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

func TestInit_BootstrapPeers(t *testing.T) {
config := Crawl{
Root: &Root{Protocols: cli.NewStringSlice()},
BootstrapPeers: cli.NewStringSlice(),
Network: string(NetworkIPFS),
}
Expand All @@ -22,7 +21,6 @@ func TestInit_BootstrapPeers(t *testing.T) {

func TestConfig_BootstrapAddrInfos(t *testing.T) {
config := Crawl{
Root: &Root{Protocols: cli.NewStringSlice()},
BootstrapPeers: cli.NewStringSlice(),
Network: string(NetworkIPFS),
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/crawl/crawler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"

"github.com/dennis-tra/nebula-crawler/pkg/config"
"github.com/dennis-tra/nebula-crawler/pkg/queue"
"github.com/dennis-tra/nebula-crawler/pkg/utils"
)

func TestNewCrawler_correctInit(t *testing.T) {
conf := &config.Config{}
conf := &config.Crawl{Protocols: cli.NewStringSlice(), Root: &config.Root{}}
crawler, err := NewCrawler(nil, conf)
require.NoError(t, err)

Expand All @@ -31,7 +32,7 @@ func TestNewCrawler_correctInit(t *testing.T) {
}

func TestCrawler_StartCrawling_stopsOnShutdown(t *testing.T) {
crawler, err := NewCrawler(nil, &config.Config{})
crawler, err := NewCrawler(nil, &config.Crawl{Protocols: cli.NewStringSlice(), Root: &config.Root{}})
require.NoError(t, err)

ctx, cancel := context.WithCancel(context.Background())
Expand All @@ -55,7 +56,7 @@ func TestCrawler_handleCrawlJob_unlinked(t *testing.T) {
remote, err := net.GenPeer()
require.NoError(t, err)

crawler, err := NewCrawler(h, &config.Config{})
crawler, err := NewCrawler(h, &config.Crawl{Protocols: cli.NewStringSlice(), Root: &config.Root{}})
require.NoError(t, err)

pi := peer.AddrInfo{
Expand Down
16 changes: 11 additions & 5 deletions pkg/db/db_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ func clearDatabase(ctx context.Context, db *sql.DB) error {
func setup(t *testing.T) (context.Context, *DBClient, func(t *testing.T)) {
ctx := context.Background()

c := config.Root{}
c.DatabaseName = "nebula_test"
c.DatabaseUser = "nebula_test"
c.DatabasePassword = "password_test"
c.DatabasePort = 2345
c := config.Root{
DatabaseHost: "localhost",
DatabasePort: 2345,
DatabaseName: "nebula_test",
DatabasePassword: "password_test",
DatabaseUser: "nebula_test",
DatabaseSSLMode: "disable",
AgentVersionsCacheSize: 100,
ProtocolsCacheSize: 100,
ProtocolsSetCacheSize: 100,
}

client, err := InitDBClient(ctx, &c)
require.NoError(t, err)
Expand Down
1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit cf062f9

Please sign in to comment.