Skip to content

Conversation

@bhapas
Copy link
Contributor

@bhapas bhapas commented Jun 8, 2023

The terraform output file sometimes is empty and json unmarshall throws an error.

The fix is to validate the json file before unmarshalling it.

@bhapas
Copy link
Contributor Author

bhapas commented Jun 8, 2023

/test

@bhapas bhapas force-pushed the test-aws-package branch from 250ffbf to a57beeb Compare June 8, 2023 12:29
@bhapas bhapas self-assigned this Jun 8, 2023
@bhapas bhapas requested a review from mrodm June 8, 2023 12:29
@bhapas bhapas changed the title Test aws package for flaky test Remove terraform output to unblock flaky aws package test Jun 8, 2023
@bhapas
Copy link
Contributor Author

bhapas commented Jun 8, 2023

/test

@mrodm mrodm requested a review from a team June 8, 2023 13:51
@bhapas bhapas requested a review from mrodm June 8, 2023 14:33
@bhapas bhapas changed the title Remove terraform output to unblock flaky aws package test Validate JSON output file before unmarshall Jun 8, 2023
Comment on lines +68 to +71
if !json.Valid(content) {
logger.Debug("Invalid Json content in the terraform output file, skipped creating outputs")
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if aws_logs has an invalid json here? Would the test package fail if that happens ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The system test fails on the package if there is an invalid json because the output is not available in the system test config

@bhapas bhapas force-pushed the test-aws-package branch from 5495abb to 04d629b Compare June 8, 2023 15:20
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @bhapas

@bhapas bhapas merged commit 5ad8bd8 into elastic:main Jun 8, 2023
@bhapas bhapas deleted the test-aws-package branch June 8, 2023 16:20
mrodm added a commit to mrodm/elastic-package that referenced this pull request Jun 8, 2023
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.

Terraform outputs in aws package make the test flaky

3 participants