Skip to content

Commit

Permalink
Merge pull request #655 from newrelic/dev
Browse files Browse the repository at this point in the history
Release 10.9
  • Loading branch information
zsistla authored Apr 3, 2023
2 parents 69952bc + 65bfbba commit d563196
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 11 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,40 @@ on:
type: string

jobs:
daemon_release:
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-go
IMAGE_VERSION: v1
runs-on: ubuntu-latest
strategy:
matrix:
platform: [gnu, musl]
arch: [amd64]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
path: newrelic-php-agent
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build daemon
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/newrelic-php-agent":"/usr/local/src/newrelic-php-agent"
-e USE_SYSTEM_CERTS=1
-e BUILD_NUMBER=${{inputs.build-number}}
$IMAGE_NAME:$IMAGE_TAG-${{ matrix.platform }}-$IMAGE_VERSION release-daemon
- name: Save build artifacts
uses: actions/upload-artifact@v3
with:
path: newrelic-php-agent/releases
name: release-from-gha
if-no-files-found: error
agent_release:
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.8.0
10.9.0
2 changes: 1 addition & 1 deletion agent/scripts/newrelic.ini.private.template
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
;newrelic.special.disable_instrumentation = ""

; Setting: newrelic.special.expensive_node_min
; Type : integer (time in msec)
; Type : integer (time in microseconds)
; Scope : system
; Default: 2 * NR_TIME_DIVISOR_MS
; Info : Sets the threshold for expensive transactions.
Expand Down
4 changes: 2 additions & 2 deletions axiom/nr_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
/*
* Current version naming scheme is flowers
*
* watermelon 25Jan2021 (9.16)
* xigua 21Apr2021 (9.17)
* yam 23Aug2021 (9.18)
* zomp 02Mar2022 (9.19)
Expand All @@ -37,8 +36,9 @@
* hydrangea 18Jan2023 (10.5)
* impatiens 13Feb2023 (10.6)
* jasmine 08Mar2023 (10.7)
* kalmia 27Mar2023 (10.8)
*/
#define NR_CODENAME "kalmia"
#define NR_CODENAME "lilac"

const char* nr_version(void) {
return NR_STR2(NR_VERSION);
Expand Down
2 changes: 1 addition & 1 deletion make/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ endif


.PHONY: release
release: Makefile release-version release-daemon release-installer release-agent release-docs release-scripts | releases/$(RELEASE_OS)/
release: Makefile release-version release-installer release-agent release-docs release-scripts | releases/$(RELEASE_OS)/

release-version: releases/$(RELEASE_OS)/
printf '%s\n' "$(AGENT_VERSION)" > releases/$(RELEASE_OS)/VERSION
Expand Down
19 changes: 17 additions & 2 deletions src/integration_runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
flagWorkers = flag.Int("threads", 1, "")
flagTime = flag.Bool("time", false, "time each test")
flagMaxCustomEvents = flag.Int("max_custom_events", 30000, "value for newrelic.custom_events.max_samples_stored")
flagWarnIsFail = flag.Bool("warnisfail", false, "warn result is treated as a fail")

// externalPort is the port on which we start a server to handle
// external calls.
Expand Down Expand Up @@ -384,7 +385,7 @@ func main() {

handler.Lock()
for _, tc := range tests {
if !tc.Failed && !tc.Skipped {
if !tc.Failed && !tc.Skipped && !tc.Warned {
if handler.harvests[tc.Name] == nil {
testsToRetry <- tc
}
Expand All @@ -403,28 +404,36 @@ func main() {
deleteSockfile("unix", *flagPort)

var numFailed int
var numWarned int

// Compare the output
handler.Lock()
for _, tc := range tests {
if !tc.Failed && !tc.Skipped {
if !tc.Failed && !tc.Skipped && !tc.Warned {
tc.Compare(handler.harvests[tc.Name])
}
if tc.Failed && tc.Xfail == "" {
numFailed++
}
if tc.Warned {
numWarned++
}
}

tapOutput(tests)

if numFailed > 0 {
os.Exit(1)
}
if *flagWarnIsFail && numWarned > 0 {
os.Exit(2)
}
}

var (
skipRE = regexp.MustCompile(`^(?i)\s*skip`)
xfailRE = regexp.MustCompile(`^(?i)\s*xfail`)
warnRE = regexp.MustCompile(`^(?i)\s*warn`)
)

func runTests(testsToRun chan *integration.Test, numWorkers int) {
Expand Down Expand Up @@ -548,6 +557,12 @@ func runTest(t *integration.Test) {
return
}

if warnRE.Match(body) {
reason := string(bytes.TrimSpace(head(body)))
t.Warn(reason)
return
}

if xfailRE.Match(body) {
// Strip xfail message from body so it does not affect expectations.
tmp := bytes.SplitN(body, []byte("\n"), 2)
Expand Down
8 changes: 8 additions & 0 deletions src/integration_runner/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (
type TestRunTotals struct {
passed int
skipped int
warned int
failed int
xfail int
}
Expand All @@ -51,6 +52,10 @@ func (totals *TestRunTotals) Accumulate(test *integration.Test) {
totals.skipped++
return
}
if test.Warned {
totals.warned++
return
}
if test.Failed {
if "" != test.Xfail {
totals.xfail++
Expand All @@ -71,6 +76,8 @@ func tapOutput(tests []*integration.Test) {
switch {
case test.Skipped:
fmt.Println(Warn("skip -"), name, "#", Warn(test.Err))
case test.Warned:
fmt.Println(Warn("warn -"), name, "#", Warn(test.Err))
case test.Failed:
if "" != test.Xfail {
fmt.Println("xfail -", name)
Expand Down Expand Up @@ -100,6 +107,7 @@ func tapOutput(tests []*integration.Test) {
}
fmt.Println("#", totals.passed, "passed")
fmt.Println("#", totals.skipped, "skipped")
fmt.Println("#", totals.warned, "warned")
if totals.failed == 0 {
fmt.Println("#", Good(totals.failed), Good("failed"))
} else {
Expand Down
15 changes: 15 additions & 0 deletions src/newrelic/integration/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type Test struct {

// Remaining fields are populated after the test is run.
Skipped bool
Warned bool

// If the test was skipped or the test could not be run due to an
// error, describes the reason.
Expand Down Expand Up @@ -137,6 +138,19 @@ func (t *Test) Skipf(format string, args ...interface{}) {
t.Err = fmt.Errorf(format, args...)
}

// Warn marks the test as unable to be run and records the given reason.
func (t *Test) Warn(reason string) {
t.Warned = true
t.Err = errors.New(reason)
}

// Warnf marks the test as unable to be run and formats its arguments
// according to the format, and records the text as the reason.
func (t *Test) Warnf(format string, args ...interface{}) {
t.Warned = true
t.Err = fmt.Errorf(format, args...)
}

// Fail records an unsatisified expectation for the test and marks
// the test as failed.
func (t *Test) Fail(err error) {
Expand Down Expand Up @@ -460,6 +474,7 @@ func (t *Test) Compare(harvest *newrelic.Harvest) {
func (t *Test) Reset() {
t.Xfail = ""
t.Skipped = false
t.Warned = false
t.Err = nil
t.Output = nil
t.Failed = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/*INI
newrelic.transaction_tracer.threshold = 0
newrelic.code_level_metrics.enabled = 1
newrelic.special.expensive_node_min = 1000000
*/

/*EXPECT_SPAN_EVENTS
Expand Down Expand Up @@ -64,7 +65,7 @@
},
{},
{
"code.lineno": 214,
"code.lineno": 215,
"code.filepath": "__FILE__",
"code.function": "level_2"
}
Expand All @@ -85,7 +86,7 @@
},
{},
{
"code.lineno": 210,
"code.lineno": 211,
"code.filepath": "__FILE__",
"code.function": "level_1"
}
Expand Down Expand Up @@ -146,15 +147,15 @@
[
"?? start time", "?? end time", "`1",
{
"code.lineno": 214,
"code.lineno": 215,
"code.filepath": "__FILE__",
"code.function": "level_2"
},
[
[
"?? start time", "?? end time", "`2",
{
"code.lineno": 210,
"code.lineno": 211,
"code.filepath": "__FILE__",
"code.function": "level_1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/*INI
newrelic.transaction_tracer.threshold = 0
newrelic.code_level_metrics.enabled = 0
newrelic.special.expensive_node_min = 1000000
*/

/*EXPECT_SPAN_EVENTS
Expand Down

0 comments on commit d563196

Please sign in to comment.