Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for cloud ints #32

Merged
merged 14 commits into from
Dec 17, 2019
Merged

Add tests for cloud ints #32

merged 14 commits into from
Dec 17, 2019

Conversation

Ricky-Thomas
Copy link
Contributor

Required test suite for generate Go client.

Also randomized certain credentials in each test file to ensure test idempotency.

@Ricky-Thomas Ricky-Thomas requested a review from a team as a code owner November 22, 2019 21:02
@Ricky-Thomas
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jirikuncar
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Ricky-Thomas
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@nmuesch nmuesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Left some comments but should be good after that.

Mostly

  • Lets check for errors + httpResp codes anytime we call an endpoint
  • We should defer the uninstallation of any updated accounts being created
  • Lets use the account variables in the assertions being done instead of the hardcoded values.

api/v1/datadog/api_aws_logs_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_aws_logs_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_aws_logs_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_aws_logs_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_aws_logs_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_azure_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_azure_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_gcp_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_gcp_integration_test.go Outdated Show resolved Hide resolved
api/v1/datadog/api_gcp_integration_test.go Outdated Show resolved Hide resolved
@Ricky-Thomas
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nmuesch
Copy link
Contributor

nmuesch commented Dec 17, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nmuesch
Copy link
Contributor

nmuesch commented Dec 17, 2019

/azp run

1 similar comment
@jirikuncar
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).


var UNIQUEACCOUNTID = fmt.Sprintf("12345%s", time.Now())

var TESTAWSACCLOGS = datadog.AwsAccount{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should create a factory function so each testcase creates it's unique AwsAccount, AwsAccountAndLambdaInput and AwsLogsServicesInput.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I added a quick commit to add this. (talked to @Ricky-Thomas offline)

@nmuesch
Copy link
Contributor

nmuesch commented Dec 17, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nmuesch
Copy link
Contributor

nmuesch commented Dec 17, 2019

@nmuesch
Copy link
Contributor

nmuesch commented Dec 17, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@jirikuncar jirikuncar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

list_output_2, _, _ := TESTAPICLIENT.AWSLogsIntegrationApi.AWSLogsList(TESTAUTH)

var list_of_arns_2 []datadog.AwsLogsListOutputLambdas
x = false
Copy link
Contributor

@jirikuncar jirikuncar Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = false
existsAfterDelete = false

}
}
// Check that ARN no longer exists after delete
assert.Assert(t, x != true)
Copy link
Contributor

@jirikuncar jirikuncar Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.Assert(t, x != true)
assert.Assert(t, !existsAfterDelete)

@nmuesch nmuesch merged commit 5b2b32d into master Dec 17, 2019
@nmuesch nmuesch deleted the ricky/add_cloud_ints_tests branch December 17, 2019 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants