Skip to content

Commit b55f80d

Browse files
committed
Mention release candidate and deprecate GinkgoParallelNode in favor of GinkgoParallelProcess
1 parent d8e9d10 commit b55f80d

10 files changed

+59
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Jump to the [docs](https://onsi.github.io/ginkgo/) | [中文文档](https://ke-c
66

77
If you have a question, comment, bug report, feature request, etc. please open a GitHub issue, or visit the [Ginkgo Slack channel](https://app.slack.com/client/T029RQSE6/CQQ50BBNW).
88

9-
# Ginkgo 2.0 beta is available!
9+
# Ginkgo 2.0 Release Candidate is available!
1010

1111
An effort is underway to develop and deliver Ginkgo 2.0. The work is happening in the [ver2](https://github.com/onsi/ginkgo/tree/ver2) branch and a changelog and migration guide is being maintained on that branch [here](https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md). Issue [#711](https://github.com/onsi/ginkgo/issues/711) is the central place for discussion.
1212

1313
As described in the [changelog](https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md) and [proposal](https://docs.google.com/document/d/1h28ZknXRsTLPNNiOjdHIO-F2toCzq4xoZDXbfYaBdoQ/edit#), Ginkgo 2.0 will clean up the Ginkgo codebase, deprecate and remove some v1 functionality, and add several new much-requested features. To help users get ready for the migration, Ginkgo v1 has started emitting deprecation warnings for features that will no longer be supported with links to documentation for how to migrate away from these features. If you have concerns or comments please chime in on [#711](https://github.com/onsi/ginkgo/issues/711).
1414

15-
Please start exploring and using the V2 release! To get started follow the [Using the Beta](https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#using-the-beta) directions in the migration guide.
15+
Please start exploring and using the V2 release! To get started follow the [Using the Release Candidate](https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#using-the-beta) directions in the migration guide.
1616

1717
## TLDR
1818
Ginkgo builds on Go's `testing` package, allowing expressive [Behavior-Driven Development](https://en.wikipedia.org/wiki/Behavior-driven_development) ("BDD") style tests.

ginkgo/bootstrap_command.go

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func BuildBootstrapCommand() *Command {
3737
},
3838
Command: func(args []string, additionalArgs []string) {
3939
generateBootstrap(agouti, noDot, internal, customBootstrapFile)
40+
emitRCAdvertisement()
4041
},
4142
}
4243
}

ginkgo/generate_command.go

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func BuildGenerateCommand() *Command {
3636
},
3737
Command: func(args []string, additionalArgs []string) {
3838
generateSpec(args, agouti, noDot, internal, customTestFile)
39+
emitRCAdvertisement()
3940
},
4041
}
4142
}

ginkgo/help_command.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ func BuildHelpCommand() *Command {
2020
func printHelp(args []string, additionalArgs []string) {
2121
if len(args) == 0 {
2222
usage()
23+
emitRCAdvertisement()
2324
} else {
2425
command, found := commandMatching(args[0])
2526
if !found {
2627
complainAndQuit(fmt.Sprintf("Unknown command: %s", args[0]))
2728
}
2829

2930
usageForCommand(command, true)
31+
emitRCAdvertisement()
3032
}
3133
}

ginkgo/main.go

+29
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ import (
131131
"fmt"
132132
"os"
133133
"os/exec"
134+
"path/filepath"
134135
"strings"
135136

136137
"github.com/onsi/ginkgo/config"
138+
"github.com/onsi/ginkgo/formatter"
137139
"github.com/onsi/ginkgo/ginkgo/testsuite"
138140
)
139141

@@ -243,6 +245,7 @@ func usageForCommand(command *Command, longForm bool) {
243245

244246
func complainAndQuit(complaint string) {
245247
fmt.Fprintf(os.Stderr, "%s\nFor usage instructions:\n\tginkgo help\n", complaint)
248+
emitRCAdvertisement()
246249
os.Exit(1)
247250
}
248251

@@ -306,3 +309,29 @@ func pluralizedWord(singular, plural string, count int) string {
306309
}
307310
return plural
308311
}
312+
313+
func emitRCAdvertisement() {
314+
ackRC := os.Getenv("ACK_GINKGO_RC")
315+
if ackRC != "" {
316+
return
317+
}
318+
home, err := os.UserHomeDir()
319+
if err == nil {
320+
_, err := os.Stat(filepath.Join(home, ".ack-ginkgo-rc"))
321+
if err == nil {
322+
return
323+
}
324+
}
325+
326+
out := formatter.F("\n{{light-yellow}}Ginkgo 2.0 is coming soon!{{/}}\n")
327+
out += formatter.F("{{light-yellow}}=========================={{/}}\n")
328+
out += formatter.F("{{bold}}{{green}}Ginkgo 2.0{{/}} is under active development and will introduce several new features, improvements, and a small handful of breaking changes.\n")
329+
out += formatter.F("A release candidate for 2.0 is now available and 2.0 should GA in Fall 2021. {{bold}}Please give the RC a try and send us feedback!{{/}}\n")
330+
out += formatter.F(" - To learn more, view the migration guide at {{cyan}}{{underline}}https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md{{/}}\n")
331+
out += formatter.F(" - For instructions on using the Release Candidate visit {{cyan}}{{underline}}https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#using-the-beta{{/}}\n")
332+
out += formatter.F(" - To comment, chime in at {{cyan}}{{underline}}https://github.com/onsi/ginkgo/issues/711{{/}}\n\n")
333+
out += formatter.F("To {{bold}}{{coral}}silence this notice{{/}}, set the environment variable: {{bold}}ACK_GINKGO_RC=true{{/}}\n")
334+
out += formatter.F("Alternatively you can: {{bold}}touch $HOME/.ack-ginkgo-rc{{/}}")
335+
336+
fmt.Println(out)
337+
}

ginkgo/run_command.go

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func (r *SpecRunner) RunSpecs(args []string, additionalArgs []string) {
161161
}
162162
} else {
163163
fmt.Printf("Test Suite Failed\n")
164+
emitRCAdvertisement()
164165
os.Exit(1)
165166
}
166167
}

ginkgo/version_command.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ func BuildVersionCommand() *Command {
2121

2222
func printVersion([]string, []string) {
2323
fmt.Printf("Ginkgo Version %s\n", config.VERSION)
24+
emitRCAdvertisement()
2425
}

ginkgo_dsl.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,15 @@ func GinkgoRandomSeed() int64 {
7373
return config.GinkgoConfig.RandomSeed
7474
}
7575

76-
//GinkgoParallelNode returns the parallel node number for the current ginkgo process
77-
//The node number is 1-indexed
76+
//GinkgoParallelNode is deprecated, use GinkgoParallelProcess instead
7877
func GinkgoParallelNode() int {
78+
deprecationTracker.TrackDeprecation(types.Deprecations.ParallelNode(), codelocation.New(1))
79+
return GinkgoParallelProcess()
80+
}
81+
82+
//GinkgoParallelProcess returns the parallel process number for the current ginkgo process
83+
//The process number is 1-indexed
84+
func GinkgoParallelProcess() int {
7985
return config.GinkgoConfig.ParallelNode
8086
}
8187

internal/writer/writer_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var _ = Describe("Writer", func() {
2020
It("should stream directly to the outbuffer by default", func() {
2121
writer.Write([]byte("foo"))
2222
Ω(out).Should(gbytes.Say("foo"))
23+
Fail("boom")
2324
})
2425

2526
It("should not emit the header when asked to DumpOutWitHeader", func() {

types/deprecation_support.go

+13-3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ func (d deprecations) Measure() Deprecation {
5252
}
5353
}
5454

55+
func (d deprecations) ParallelNode() Deprecation {
56+
return Deprecation{
57+
Message: "GinkgoParallelNode is deprecated and will be removed in Ginkgo V2. Please use GinkgoParallelProcess instead.",
58+
DocLink: "renamed-ginkgoparallelnode",
59+
Version: "1.16.5",
60+
}
61+
}
62+
5563
func (d deprecations) Convert() Deprecation {
5664
return Deprecation{
5765
Message: "The convert command is deprecated in Ginkgo V2",
@@ -101,9 +109,11 @@ func (d *DeprecationTracker) DidTrackDeprecations() bool {
101109
func (d *DeprecationTracker) DeprecationsReport() string {
102110
out := formatter.F("{{light-yellow}}You're using deprecated Ginkgo functionality:{{/}}\n")
103111
out += formatter.F("{{light-yellow}}============================================={{/}}\n")
104-
out += formatter.F("Ginkgo 2.0 is under active development and will introduce (a small number of) breaking changes.\n")
105-
out += formatter.F("To learn more, view the migration guide at {{cyan}}{{underline}}https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md{{/}}\n")
106-
out += formatter.F("To comment, chime in at {{cyan}}{{underline}}https://github.com/onsi/ginkgo/issues/711{{/}}\n\n")
112+
out += formatter.F("{{bold}}{{green}}Ginkgo 2.0{{/}} is under active development and will introduce several new features, improvements, and a small handful of breaking changes.\n")
113+
out += formatter.F("A release candidate for 2.0 is now available and 2.0 should GA in Fall 2021. {{bold}}Please give the RC a try and send us feedback!{{/}}\n")
114+
out += formatter.F(" - To learn more, view the migration guide at {{cyan}}{{underline}}https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md{{/}}\n")
115+
out += formatter.F(" - For instructions on using the Release Candidate visit {{cyan}}{{underline}}https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#using-the-beta{{/}}\n")
116+
out += formatter.F(" - To comment, chime in at {{cyan}}{{underline}}https://github.com/onsi/ginkgo/issues/711{{/}}\n\n")
107117

108118
for deprecation, locations := range d.deprecations {
109119
out += formatter.Fi(1, "{{yellow}}"+deprecation.Message+"{{/}}\n")

0 commit comments

Comments
 (0)