Skip to content

Commit

Permalink
STAC-21039: Fix rtloader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
craffit committed May 2, 2024
1 parent 8139b7f commit 832e66d
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 18 deletions.
5 changes: 2 additions & 3 deletions local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,10 @@ if [ "${WHAT}" = "CMD" ]; then
cd $SRC_PATH || exit

echo " --- ---"
echo " --- Running command ${@:2} "
echo " --- Running command `$2`"
echo " --- ---"


$("${@:2}")
$2

cd "$CI_PROJECT_DIR" || exit
fi
1 change: 1 addition & 0 deletions rtloader/common/builtins/_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Copyright 2019-present Datadog, Inc.
#ifndef DATADOG_AGENT_RTLOADER_UTIL__H
#define DATADOG_AGENT_RTLOADER_UTIL__H
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/datadog_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/health.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/kubeutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/tagger.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
tagger generate tags. This memory should be freed with the cgo_free helper
available when done.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
callback function.
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
The callback is expected to be provided by the rtloader caller - in go-context: CGO.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
2 changes: 1 addition & 1 deletion rtloader/common/builtins/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
The prototypes here defined provide functions to initialize the python util
builtin module, and set its relevant callbacks for the rtloader caller.
*/

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader_types.h>

Expand Down
1 change: 1 addition & 0 deletions rtloader/common/stringutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
extern "C" {
#endif

#define PY_SSIZE_T_CLEAN
#include <Python.h>

int init_stringutils(void);
Expand Down
6 changes: 3 additions & 3 deletions rtloader/test/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package testtelemetry
import (
"encoding/json"
"fmt"
"github.com/DataDog/datadog-agent/pkg/metrics"
"github.com/DataDog/datadog-agent/pkg/metrics/event"
"io/ioutil"
"log"
"os"
Expand Down Expand Up @@ -33,7 +33,7 @@ var (
rtloader *C.rtloader_t
checkID string
_data map[string]interface{}
_topoEvt metrics.Event
_topoEvt event.Event
rawName string
rawHostname string
rawValue float64
Expand All @@ -44,7 +44,7 @@ var (
func resetOuputValues() {
checkID = ""
_data = nil
_topoEvt = metrics.Event{}
_topoEvt = event.Event{}
rawName = ""
rawHostname = ""
rawValue = 0
Expand Down
4 changes: 2 additions & 2 deletions rtloader/test/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package testtelemetry

import (
"fmt"
"github.com/DataDog/datadog-agent/pkg/metrics"
"github.com/DataDog/datadog-agent/pkg/metrics/event"
"github.com/stretchr/testify/assert"
"os"
"strings"
Expand Down Expand Up @@ -212,7 +212,7 @@ func TestSubmitTopologyChangeRequestEvents(t *testing.T) {
t.Fatalf("Unexpected topology event data 'context.source_links' size: %v", len(_topoEvt.EventContext.SourceLinks))
}

emptySourceLinks := make([]metrics.SourceLink, 0)
emptySourceLinks := make([]event.SourceLink, 0)
if !assert.ObjectsAreEqualValues(_topoEvt.EventContext.SourceLinks, emptySourceLinks) {
t.Fatalf("Unexpected topology event data 'context.source_links' value: %v", _topoEvt.EventContext.SourceLinks)
}
Expand Down
1 change: 1 addition & 0 deletions rtloader/three/three.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string>
#include <vector>

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader.h>

Expand Down
1 change: 1 addition & 0 deletions rtloader/two/two.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <string>
#include <vector>

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <rtloader.h>

Expand Down

0 comments on commit 832e66d

Please sign in to comment.