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

GitHub workflow file. #35

Merged
merged 12 commits into from
Jun 3, 2022
Merged

GitHub workflow file. #35

merged 12 commits into from
Jun 3, 2022

Conversation

SOPHIA2401
Copy link
Contributor

Signed-off-by: Sophia Garg sofigarg@amazon.com

Description

Workflow file for running Continuous Integration.

Issues Resolved

Adding CI to validate smithy models.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Comment on lines 3 to 10
for i in range(0,6):
command = "curl 'https://admin:admin@localhost:9200' -H 'Content-Type:application/json' --insecure -v"
result = os.system(command)
if result !=0:
os.system("sleep 30s")
else:
os.system("sleep 30s")
break
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be directly written in shell script as part of CI workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, It can be added and corrected in commit 6eb89bc.

if result !=0:
os.system("sleep 30s")
else:
os.system("sleep 30s")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we adding sleep here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another 30 seconds are required for the OpenSearch domain to become operational.

python driver-code.py
shell: bash
working-directory: ./test

Copy link
Contributor

Choose a reason for hiding this comment

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

Add newline to end of file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in latest commit.

.github/workflows/ci.yaml Show resolved Hide resolved
shell: bash
working-directory: ./test

- name: Setting up OpenSearch domain
Copy link
Contributor

@pgtgrly pgtgrly May 13, 2022

Choose a reason for hiding this comment

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

Let's rename it to Waiting for Opensearch Domain to be up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to "Waiting for OpenSearch domain to be up."

@@ -0,0 +1,11 @@
import os

for i in range(0,6):
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 the domain is not up when i = 6? we need to throw an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected in commit 6eb89bc.

Sophia Garg added 3 commits May 13, 2022 23:53
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
@abhivka7 abhivka7 self-requested a review May 19, 2022 04:52
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Show resolved Hide resolved
type: string
minimum_index_compatibility_version:
type: string

Copy link
Contributor

Choose a reason for hiding this comment

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

newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

else:
test_passed = test_passed+1
print("Total test cases: ", test_passed+test_failed)
print("Test failed: ", test_failed)
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets print the failed tests as form of table, Please check pretty-table

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a script that prints tables for failed test cases by default and generates tables for passed test cases with an additional argument (--testpass True).

Sophia Garg added 2 commits May 19, 2022 13:15
…ts in ci workflow file and new-line added in ping model test-case.

Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
run: npm install https

- name: Installing file module
run: npm install fs
Copy link
Member

Choose a reason for hiding this comment

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

I recommend making a package.json, doing npm install and committing a .lock file, or else this will be a moving target and will break continuously.

Copy link
Contributor Author

@SOPHIA2401 SOPHIA2401 Jun 1, 2022

Choose a reason for hiding this comment

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

Added package.json and .lock file for all node modules in the commit f58fc02 except the dredd module because of it's broken npm install. I have reached out to the dredd team for the same.

run: npm install fs

- name: Installing prettytable module
run: python -m pip install -U prettytable
Copy link
Member

Choose a reason for hiding this comment

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

Recommend adding a Pipfile and using pipenv with a lock, same as for npm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected in commit f58fc02.

exit 1
fi
shell: bash
working-directory: ./test
Copy link
Member

Choose a reason for hiding this comment

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

Maybe move this into a .sh file and call that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's a little piece of code, I think we should keep it in the same file and reduce the unnecessary files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a separate file for the same 1811afc.

version: '3'
services:
opensearch-node1:
image: opensearchproject/opensearch:latest
Copy link
Member

Choose a reason for hiding this comment

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

We'll want a matrix of versions tested here. Can be added later, but consider it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will work on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created an issue to keep track of it #43.

Sophia Garg added 3 commits May 30, 2022 13:17
…ckage-lock.json for node modules and script folder added for all script files.

Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
@SOPHIA2401 SOPHIA2401 merged commit a95097a into opensearch-project:main Jun 3, 2022
SOPHIA2401 added a commit that referenced this pull request Jun 3, 2022
@SOPHIA2401 SOPHIA2401 mentioned this pull request Jun 23, 2022
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.

5 participants