-
Notifications
You must be signed in to change notification settings - Fork 66
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
GitHub workflow file. #35
Conversation
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
.github/workflows/test_url.py
Outdated
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
.github/workflows/test_url.py
Outdated
if result !=0: | ||
os.system("sleep 30s") | ||
else: | ||
os.system("sleep 30s") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
.github/workflows/ci.yaml
Outdated
python driver-code.py | ||
shell: bash | ||
working-directory: ./test | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Outdated
shell: bash | ||
working-directory: ./test | ||
|
||
- name: Setting up OpenSearch domain |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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."
.github/workflows/test_url.py
Outdated
@@ -0,0 +1,11 @@ | |||
import os | |||
|
|||
for i in range(0,6): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected in commit 6eb89bc.
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
Signed-off-by: Sophia Garg <sofigarg@amazon.com>
type: string | ||
minimum_index_compatibility_version: | ||
type: string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
test/driver-code.py
Outdated
else: | ||
test_passed = test_passed+1 | ||
print("Total test cases: ", test_passed+test_failed) | ||
print("Test failed: ", test_failed) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
…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>
.github/workflows/ci.yaml
Outdated
run: npm install https | ||
|
||
- name: Installing file module | ||
run: npm install fs |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
.github/workflows/ci.yaml
Outdated
run: npm install fs | ||
|
||
- name: Installing prettytable module | ||
run: python -m pip install -U prettytable |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected in commit f58fc02.
.github/workflows/ci.yaml
Outdated
exit 1 | ||
fi | ||
shell: bash | ||
working-directory: ./test |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…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>
This reverts commit a95097a.
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.