Skip to content

Commit

Permalink
Linting and type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulreddy15 committed Jan 24, 2025
1 parent 133f90c commit cff9fe3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/integrations/legacy/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,9 @@ func (rs *RunnerSuite) TestPluginHandleOutputV1(c *C) {
c.Assert(len(rd.Data), Equals, 8)
c.Assert(rd.Data[0].SortKey(), Equals, "first")

invData := rd.Data[5].(protocol.InventoryData)
invData, success := rd.Data[5].(protocol.InventoryData)
c.Assert(success, Equals, true) // checking successful type conversion

c.Assert(invData["id"], Equals, "integrationUser")
c.Assert(invData["value"], Equals, "test")

Expand Down Expand Up @@ -1598,9 +1600,7 @@ func TestEmitPayloadV2NoDisplayNameNoEntityName(t *testing.T) {

func createMockConfigWithDataMap(attrs map[string]interface{}) *config.Config {
customAttrs := config.CustomAttributeMap(attrs)
return &config.Config{
CustomAttributes: customAttrs,
}
return &config.Config{CustomAttributes: customAttrs}

Check failure on line 1603 in pkg/integrations/legacy/runner_test.go

View workflow job for this annotation

GitHub Actions / linter-linux / Run Linter

config.Config is missing fields Databind, License, Fedramp, Staging, CollectorURL, IdentityURL, MetricURL, DMIngestEndpoint, CommandChannelURL, CommandChannelEndpoint, CommandChannelIntervalSec, IgnoreSystemProxy, Proxy, ProxyValidateCerts, ProxyConfigPlugin, IgnoreReclaimable, DisplayName, DisableInventorySplit, DnsHostnameResolution, DockerApiVersion, DockerContainerdNamespace, Verbose, SmartVerboseModeEntryLimit, CPUProfile, MemProfile, MemProfileInterval, WebProfile, StripCommandLine, OverrideHostname, OverrideHostnameShort, OverrideHostProc, OverrideHostSys, OverrideHostEtc, OverrideHostRoot, IsContainerized, IsForwardOnly, IsSecureForwardOnly, IsIntegrationsOnly, K8sIntegration, AgentDir, SafeBinDir, ConfigDir, TruncTextValues, LogFormat, LogFile, Log, PidFile, MaxInventorySize, MaxProcs, MetricsSystemSampleRate, MetricsStorageSampleRate, MetricsNetworkSampleRate, MetricsProcessSampleRate, HeartBeatSampleRate, DMSubmissionPeriod, CustomSupportedFileSystems, FileDevicesBlacklist, FileDevicesIgnored, NetworkInterfaceFilters, IpData, CABundleFile, CABundleDir, SupervisorRpcSocket, SupervisorRefreshSec, RpmRefreshSec, DpkgRefreshSec, DaemontoolsRefreshSec, FacterIntervalSec, FacterHomeDir, SelinuxIntervalSec, SelinuxEnableSemodule, SysctlFSNotify, SysctlIntervalSec, SystemdIntervalSec, SysvInitIntervalSec, UpstartIntervalSec, NetworkInterfaceIntervalSec, CloudSecurityGroupRefreshSec, KernelModulesRefreshSec, UsersRefreshSec, SshdConfigRefreshSec, WindowsServicesRefreshSec, WindowsUpdatesRefreshSec, LogToStdout, ContainerMetadataCacheLimit, PayloadCompressionLevel, PartitionsTTL, StartupConnectionTimeout, StartupConnectionRetries, FingerprintUpdateFreqSec, ForceProtocolV2toV3, DisableAllPlugins, EventQueueDepth, BatchQueueDepth, InventoryQueueLen, AsyncInventoryHandlerEnabled, EnableWinUpdatePlugin, InventoryArchiveEnabled, CompactEnabled, CompactThreshold, IgnoredInventoryPaths, WhitelistProcessSample, AllowedListProcessSample, DisableWinSharedWMI, DisableZeroRSSFilter, EnableElevatedProcessPriv, EnableWmiProcData, OfflineTimeToReset, Features, RegisterConcurrency, RegisterBatchSize, RegisterFrequencySecs, CustomPluginInstallationDir, PluginDir, PassthroughEnvironment, PluginConfigFiles, PluginInstanceDirs, LoggingConfigsDir, LoggingBinDir, LoggingHomeDir, LoggingRetryLimit, FluentBitExePath, FluentBitParsersPath, FluentBitNRLibPath, HTTPServerEnabled, HTTPServerHost, HTTPServerPort, HTTPServerCert, HTTPServerKey, HTTPServerCA, TCPServerEnabled, TCPServerPort, StatusServerEnabled, StatusServerPort, StatusEndpoints, HealthEndpoint, AppDataDir, DisableCloudMetadata, DisableCloudInstanceId, CloudProvider, CloudMaxRetryCount, CloudRetryBackOffSec, RegisterMaxRetryBoSecs, CloudMetadataExpiryInSec, CloudMetadataDisableKeepAlive, RemoveEntitiesPeriod, MetricsIngestEndpoint, InventoryIngestEndpoint, IdentityIngestEndpoint, MaxMetricsBatchSizeBytes, MaxMetricBatchEntitiesCount, MaxMetricBatchEntitiesQueue, ConnectEnabled, RegisterEnabled, FilesConfigOn, DebugLogSec, OfflineLoggingMode, WinProcessPriorityClass, WinRemovableDrives, LegacyStorageSampler, RunMode, AgentUser, ExecutablePath, FirstReapInterval, ReapInterval, SendInterval, IgnoredInventoryPathsMap, K8sIntegrationSamplesIntervalSec, MetricsNFSSampleRate, DetailedNFS, DefaultIntegrationsTempDir, EnableProcessMetrics, IncludeMetricsMatchers, ExcludeMetricsMatchers, AgentMetricsEndpoint, SelfInstrumentation, SelfInstrumentationApmHost, SelfInstrumentationTelemetryEndpoint, NtpMetrics, Http, AgentTempDir, ProcessContainerDecoration (exhaustruct)

Check failure on line 1603 in pkg/integrations/legacy/runner_test.go

View workflow job for this annotation

GitHub Actions / linter-macos / Lint tests

config.Config is missing fields Databind, License, Fedramp, Staging, CollectorURL, IdentityURL, MetricURL, DMIngestEndpoint, CommandChannelURL, CommandChannelEndpoint, CommandChannelIntervalSec, IgnoreSystemProxy, Proxy, ProxyValidateCerts, ProxyConfigPlugin, IgnoreReclaimable, DisplayName, DisableInventorySplit, DnsHostnameResolution, DockerApiVersion, DockerContainerdNamespace, Verbose, SmartVerboseModeEntryLimit, CPUProfile, MemProfile, MemProfileInterval, WebProfile, StripCommandLine, OverrideHostname, OverrideHostnameShort, OverrideHostProc, OverrideHostSys, OverrideHostEtc, OverrideHostRoot, IsContainerized, IsForwardOnly, IsSecureForwardOnly, IsIntegrationsOnly, K8sIntegration, AgentDir, SafeBinDir, ConfigDir, TruncTextValues, LogFormat, LogFile, Log, PidFile, MaxInventorySize, MaxProcs, MetricsSystemSampleRate, MetricsStorageSampleRate, MetricsNetworkSampleRate, MetricsProcessSampleRate, HeartBeatSampleRate, DMSubmissionPeriod, CustomSupportedFileSystems, FileDevicesBlacklist, FileDevicesIgnored, NetworkInterfaceFilters, IpData, CABundleFile, CABundleDir, SupervisorRpcSocket, SupervisorRefreshSec, RpmRefreshSec, DpkgRefreshSec, DaemontoolsRefreshSec, FacterIntervalSec, FacterHomeDir, SelinuxIntervalSec, SelinuxEnableSemodule, SysctlFSNotify, SysctlIntervalSec, SystemdIntervalSec, SysvInitIntervalSec, UpstartIntervalSec, NetworkInterfaceIntervalSec, CloudSecurityGroupRefreshSec, KernelModulesRefreshSec, UsersRefreshSec, SshdConfigRefreshSec, WindowsServicesRefreshSec, WindowsUpdatesRefreshSec, LogToStdout, ContainerMetadataCacheLimit, PayloadCompressionLevel, PartitionsTTL, StartupConnectionTimeout, StartupConnectionRetries, FingerprintUpdateFreqSec, ForceProtocolV2toV3, DisableAllPlugins, EventQueueDepth, BatchQueueDepth, InventoryQueueLen, AsyncInventoryHandlerEnabled, EnableWinUpdatePlugin, InventoryArchiveEnabled, CompactEnabled, CompactThreshold, IgnoredInventoryPaths, WhitelistProcessSample, AllowedListProcessSample, DisableWinSharedWMI, DisableZeroRSSFilter, EnableElevatedProcessPriv, EnableWmiProcData, OfflineTimeToReset, Features, RegisterConcurrency, RegisterBatchSize, RegisterFrequencySecs, CustomPluginInstallationDir, PluginDir, PassthroughEnvironment, PluginConfigFiles, PluginInstanceDirs, LoggingConfigsDir, LoggingBinDir, LoggingHomeDir, LoggingRetryLimit, FluentBitExePath, FluentBitParsersPath, FluentBitNRLibPath, HTTPServerEnabled, HTTPServerHost, HTTPServerPort, HTTPServerCert, HTTPServerKey, HTTPServerCA, TCPServerEnabled, TCPServerPort, StatusServerEnabled, StatusServerPort, StatusEndpoints, HealthEndpoint, AppDataDir, DisableCloudMetadata, DisableCloudInstanceId, CloudProvider, CloudMaxRetryCount, CloudRetryBackOffSec, RegisterMaxRetryBoSecs, CloudMetadataExpiryInSec, CloudMetadataDisableKeepAlive, RemoveEntitiesPeriod, MetricsIngestEndpoint, InventoryIngestEndpoint, IdentityIngestEndpoint, MaxMetricsBatchSizeBytes, MaxMetricBatchEntitiesCount, MaxMetricBatchEntitiesQueue, ConnectEnabled, RegisterEnabled, FilesConfigOn, DebugLogSec, OfflineLoggingMode, WinProcessPriorityClass, WinRemovableDrives, LegacyStorageSampler, RunMode, AgentUser, ExecutablePath, FirstReapInterval, ReapInterval, SendInterval, IgnoredInventoryPathsMap, K8sIntegrationSamplesIntervalSec, MetricsNFSSampleRate, DetailedNFS, DefaultIntegrationsTempDir, EnableProcessMetrics, IncludeMetricsMatchers, ExcludeMetricsMatchers, AgentMetricsEndpoint, SelfInstrumentation, SelfInstrumentationApmHost, SelfInstrumentationTelemetryEndpoint, NtpMetrics, Http, AgentTempDir, ProcessContainerDecoration (exhaustruct)

Check failure on line 1603 in pkg/integrations/legacy/runner_test.go

View workflow job for this annotation

GitHub Actions / linter-windows / Lint tests

config.Config is missing fields Databind, License, Fedramp, Staging, CollectorURL, IdentityURL, MetricURL, DMIngestEndpoint, CommandChannelURL, CommandChannelEndpoint, CommandChannelIntervalSec, IgnoreSystemProxy, Proxy, ProxyValidateCerts, ProxyConfigPlugin, IgnoreReclaimable, DisplayName, DisableInventorySplit, DnsHostnameResolution, DockerApiVersion, DockerContainerdNamespace, Verbose, SmartVerboseModeEntryLimit, CPUProfile, MemProfile, MemProfileInterval, WebProfile, StripCommandLine, OverrideHostname, OverrideHostnameShort, OverrideHostProc, OverrideHostSys, OverrideHostEtc, OverrideHostRoot, IsContainerized, IsForwardOnly, IsSecureForwardOnly, IsIntegrationsOnly, K8sIntegration, AgentDir, SafeBinDir, ConfigDir, TruncTextValues, LogFormat, LogFile, Log, PidFile, MaxInventorySize, MaxProcs, MetricsSystemSampleRate, MetricsStorageSampleRate, MetricsNetworkSampleRate, MetricsProcessSampleRate, HeartBeatSampleRate, DMSubmissionPeriod, CustomSupportedFileSystems, FileDevicesBlacklist, FileDevicesIgnored, NetworkInterfaceFilters, IpData, CABundleFile, CABundleDir, SupervisorRpcSocket, SupervisorRefreshSec, RpmRefreshSec, DpkgRefreshSec, DaemontoolsRefreshSec, FacterIntervalSec, FacterHomeDir, SelinuxIntervalSec, SelinuxEnableSemodule, SysctlFSNotify, SysctlIntervalSec, SystemdIntervalSec, SysvInitIntervalSec, UpstartIntervalSec, NetworkInterfaceIntervalSec, CloudSecurityGroupRefreshSec, KernelModulesRefreshSec, UsersRefreshSec, SshdConfigRefreshSec, WindowsServicesRefreshSec, WindowsUpdatesRefreshSec, LogToStdout, ContainerMetadataCacheLimit, PayloadCompressionLevel, PartitionsTTL, StartupConnectionTimeout, StartupConnectionRetries, FingerprintUpdateFreqSec, ForceProtocolV2toV3, DisableAllPlugins, EventQueueDepth, BatchQueueDepth, InventoryQueueLen, AsyncInventoryHandlerEnabled, EnableWinUpdatePlugin, InventoryArchiveEnabled, CompactEnabled, CompactThreshold, IgnoredInventoryPaths, WhitelistProcessSample, AllowedListProcessSample, DisableWinSharedWMI, DisableZeroRSSFilter, EnableElevatedProcessPriv, EnableWmiProcData, OfflineTimeToReset, Features, RegisterConcurrency, RegisterBatchSize, RegisterFrequencySecs, CustomPluginInstallationDir, PluginDir, PassthroughEnvironment, PluginConfigFiles, PluginInstanceDirs, LoggingConfigsDir, LoggingBinDir, LoggingHomeDir, LoggingRetryLimit, FluentBitExePath, FluentBitParsersPath, FluentBitNRLibPath, HTTPServerEnabled, HTTPServerHost, HTTPServerPort, HTTPServerCert, HTTPServerKey, HTTPServerCA, TCPServerEnabled, TCPServerPort, StatusServerEnabled, StatusServerPort, StatusEndpoints, HealthEndpoint, AppDataDir, DisableCloudMetadata, DisableCloudInstanceId, CloudProvider, CloudMaxRetryCount, CloudRetryBackOffSec, RegisterMaxRetryBoSecs, CloudMetadataExpiryInSec, CloudMetadataDisableKeepAlive, RemoveEntitiesPeriod, MetricsIngestEndpoint, InventoryIngestEndpoint, IdentityIngestEndpoint, MaxMetricsBatchSizeBytes, MaxMetricBatchEntitiesCount, MaxMetricBatchEntitiesQueue, ConnectEnabled, RegisterEnabled, FilesConfigOn, DebugLogSec, OfflineLoggingMode, WinProcessPriorityClass, WinRemovableDrives, LegacyStorageSampler, RunMode, AgentUser, ExecutablePath, FirstReapInterval, ReapInterval, SendInterval, IgnoredInventoryPathsMap, K8sIntegrationSamplesIntervalSec, MetricsNFSSampleRate, DetailedNFS, DefaultIntegrationsTempDir, EnableProcessMetrics, IncludeMetricsMatchers, ExcludeMetricsMatchers, AgentMetricsEndpoint, SelfInstrumentation, SelfInstrumentationApmHost, SelfInstrumentationTelemetryEndpoint, NtpMetrics, Http, AgentTempDir, ProcessContainerDecoration (exhaustruct)
}

func TestEmitDataSet_OnAddHostnameDecoratesWithHostname(t *testing.T) {
Expand Down

0 comments on commit cff9fe3

Please sign in to comment.