Skip to content

Commit 17e0c68

Browse files
fixing tests
1 parent 5d148b8 commit 17e0c68

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

cmd/ipfs/kubo/daemon.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
485485
// This should never happen, but better safe than sorry
486486
log.Fatal("Private network does not work with Routing.Type=auto. Update your config to Routing.Type=dht (or none, and do manual peering)")
487487
}
488+
if cfg.Provider.Strategy != "" && cfg.Reprovider.Strategy.IsDefault() {
489+
// Provider.Strategy isn't used anywhere.
490+
log.Fatal("Switch to using Reprovider.Strategy instead of Provider.Strategy. Update your config to remove this message.")
491+
}
488492

489493
printLibp2pPorts(node)
490494

config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ func TestCheckKey(t *testing.T) {
134134
t.Fatal("Foo.Bar isn't a valid key in the config")
135135
}
136136

137-
err = CheckKey("Provider.Strategy")
137+
err = CheckKey("Reprovider.Strategy")
138138
if err != nil {
139-
t.Fatalf("%s: %s", err, "Provider.Strategy is a valid key in the config")
139+
t.Fatalf("%s: %s", err, "Reprovider.Strategy is a valid key in the config")
140140
}
141141

142142
err = CheckKey("Provider.Foo")

core/commands/commands_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ func TestCommands(t *testing.T) {
184184
"/stats/bw",
185185
"/stats/dht",
186186
"/stats/provide",
187+
"/stats/reprovide",
187188
"/stats/repo",
188189
"/swarm",
189190
"/swarm/addrs",

core/commands/stat_provide.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import (
1313
var statProvideCmd = &cmds.Command{
1414
Status: cmds.Deprecated,
1515
Helptext: cmds.HelpText{
16-
Tagline: "Deprecated command to get provider+reprovider statistics. Use 'ipfs stats reprovide' instead.",
16+
Tagline: "Deprecated command, use 'ipfs stats reprovide' instead.",
1717
ShortDescription: `
18-
'ipfs stats provide' is depreacted because provide and reprovide operations are now distinct.
19-
This command may be replaced by provide only stats in the future.
18+
'ipfs stats provide' is depreacted because provide and reprovide operations are
19+
now distinct. This command may be replaced by provide only stats in the
20+
future.
2021
`,
2122
},
2223
Arguments: []cmds.Argument{},

test/sharness/t0002-docker-image.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_expect_success "docker image build succeeds" '
3636
'
3737

3838
test_expect_success "write init scripts" '
39-
echo "ipfs config Provider.Strategy Bar" > 001.sh &&
39+
echo "ipfs config Reprovider.Strategy Bar" > 001.sh &&
4040
echo "ipfs config Pubsub.Router Qux" > 002.sh &&
4141
chmod +x 002.sh
4242
'
@@ -65,7 +65,7 @@ test_expect_success "check that init scripts were run correctly and in the corre
6565

6666
test_expect_success "check that init script configs were applied" '
6767
echo Bar > expected &&
68-
docker exec "$DOC_ID" ipfs config Provider.Strategy > actual &&
68+
docker exec "$DOC_ID" ipfs config Reprovider.Strategy > actual &&
6969
test_cmp actual expected &&
7070
echo Qux > expected &&
7171
docker exec "$DOC_ID" ipfs config Pubsub.Router > actual &&

test/sharness/t0070-user-config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ test_description="Test user-provided config values"
1111
test_init_ipfs
1212

1313
test_expect_success "bootstrap doesn't overwrite user-provided config keys (top-level)" '
14-
ipfs config Provider.Strategy >previous &&
15-
ipfs config Provider.Strategy foo &&
14+
ipfs config Reprovider.Strategy >previous &&
15+
ipfs config Reprovider.Strategy foo &&
1616
ipfs bootstrap rm --all &&
1717
echo "foo" >expected &&
18-
ipfs config Provider.Strategy >actual &&
19-
ipfs config Provider.Strategy $(cat previous) &&
18+
ipfs config Reprovider.Strategy >actual &&
19+
ipfs config Reprovider.Strategy $(cat previous) &&
2020
test_cmp expected actual
2121
'
2222

0 commit comments

Comments
 (0)