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

Makefile: added labels to test-e2e #56

Merged
merged 1 commit into from
Feb 27, 2020
Merged

Conversation

kadern0
Copy link
Contributor

@kadern0 kadern0 commented Feb 25, 2020

Added label to test and check they are being returned on describe

Description

Added -l testing=true to deploy command and then run a describe followed by grep testing

Motivation and Context

Fixes issue #52

How Has This Been Tested?

Run the test and verified it passes:

sudo cat /var/lib/faasd/secrets/basic-auth-password | /usr/local/bin/faas-cli login --password-stdin
Calling the OpenFaaS server to validate the credentials...
WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
credentials saved for admin http://127.0.0.1:8080
/usr/local/bin/faas-cli store deploy figlet --env write_timeout=1s --env read_timeout=1s -l testing=true
WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
Function figlet already exists, attempting rolling-update.

Deployed. 200 OK.
URL: http://127.0.0.1:8080/function/figlet

sleep 5
/usr/local/bin/faas-cli list -v
Function                      	Image                                   	Invocations    	Replicas
stronghash                    	docker.io/functions/alpine:latest       	0              	1    
url-ping                      	docker.io/alexellis/faas-url-ping:0.2   	0              	1    
f1                            	docker.io/functions/figlet:latest-armhf 	0              	0    
figlet                        	docker.io/functions/figlet:0.13.0       	2              	1    
nodejs-echo                   	docker.io/alexellis/faas-nodejs-echo:0.1	0              	1    
ruby-echo                     	docker.io/alexellis/ruby-echo:0.2       	0              	1    
shrink-image                  	docker.io/functions/resizer:0.1         	0              	1    
/usr/local/bin/faas-cli describe figlet | grep testing
Labels:              testing : true
uname | /usr/local/bin/faas-cli invoke figlet
 _     _                  
| |   (_)_ __  _   ___  __
| |   | | '_ \| | | \ \/ /
| |___| | | | | |_| |>  < 
|_____|_|_| |_|\__,_/_/\_\
                          
uname | /usr/local/bin/faas-cli invoke figlet --async
Function submitted asynchronously.
sleep 10
/usr/local/bin/faas-cli list -v
Function                      	Image                                   	Invocations    	Replicas
ruby-echo                     	docker.io/alexellis/ruby-echo:0.2       	0              	1    
shrink-image                  	docker.io/functions/resizer:0.1         	0              	1    
stronghash                    	docker.io/functions/alpine:latest       	0              	1    
url-ping                      	docker.io/alexellis/faas-url-ping:0.2   	0              	1    
f1                            	docker.io/functions/figlet:latest-armhf 	0              	0    
figlet                        	docker.io/functions/figlet:0.13.0       	4              	1    
nodejs-echo                   	docker.io/alexellis/faas-nodejs-echo:0.1	0              	1    
/usr/local/bin/faas-cli remove figlet
Deleting: figlet.
Removing old function.
sleep 3
/usr/local/bin/faas-cli list
Function                      	Invocations    	Replicas
stronghash                    	0              	1    
url-ping                      	0              	1    
f1                            	0              	0    
nodejs-echo                   	0              	1    
ruby-echo                     	0              	1    
shrink-image                  	0              	1    

Then changed the grep string and verified it failed:

sudo cat /var/lib/faasd/secrets/basic-auth-password | /usr/local/bin/faas-cli login --password-stdin
Calling the OpenFaaS server to validate the credentials...
WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
credentials saved for admin http://127.0.0.1:8080
/usr/local/bin/faas-cli store deploy figlet --env write_timeout=1s --env read_timeout=1s -l testing=true
WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
Function figlet already exists, attempting rolling-update.

Deployed. 200 OK.
URL: http://127.0.0.1:8080/function/figlet

sleep 5
/usr/local/bin/faas-cli list -v
Function                      	Image                                   	Invocations    	Replicas
ruby-echo                     	docker.io/alexellis/ruby-echo:0.2       	0              	1    
shrink-image                  	docker.io/functions/resizer:0.1         	0              	1    
stronghash                    	docker.io/functions/alpine:latest       	0              	1    
url-ping                      	docker.io/alexellis/faas-url-ping:0.2   	0              	1    
f1                            	docker.io/functions/figlet:latest-armhf 	0              	0    
figlet                        	docker.io/functions/figlet:0.13.0       	4              	1    
nodejs-echo                   	docker.io/alexellis/faas-nodejs-echo:0.1	0              	1    
/usr/local/bin/faas-cli describe figlet | grep non-existing-testing
make: *** [Makefile:43: test-e2e] Error 1

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Commits:

  • I've read the CONTRIBUTION guide
  • My commit message has a body and describe how this was tested and why it is required.
  • I have signed-off my commits with git commit -s for the Developer Certificate of Origin (DCO)

Code:

  • My code follows the code style of this project.
  • [] I have added tests to cover my changes.

Docs:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@derek
Copy link

derek bot commented Feb 25, 2020

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide.
Tip: if you only have one commit so far then run: git commit --amend --signoff and then git push --force.

1 similar comment
@derek
Copy link

derek bot commented Feb 25, 2020

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide.
Tip: if you only have one commit so far then run: git commit --amend --signoff and then git push --force.

@kadern0 kadern0 force-pushed the issue-52 branch 2 times, most recently from 52380af to da90a11 Compare February 25, 2020 10:13
@alexellis
Copy link
Member

Hi @kadern0, could you squash your two commits into one?

git rebase -i HEAD~2

Alex

Signed-off-by: kadern0 <kaderno@gmail.com>
@kadern0
Copy link
Contributor Author

kadern0 commented Feb 26, 2020

Done!

@alexellis
Copy link
Member

Congrats on that rebase, you got it right first time too. Seems like CI failed, did you have time to look at why @kadern0 ?

@kadern0
Copy link
Contributor Author

kadern0 commented Feb 27, 2020

I've quickly checked last build error and I saw a timeout happening. Nothing related to this PR. Now is passing

@alexellis alexellis merged commit a0110b3 into openfaas:master Feb 27, 2020
@alexellis
Copy link
Member

There was an issue with downloading the CLI, I've patched its get.sh script. There was also a 404 error trying to invoke figlet, but that doesn't happen every time.

@alexellis
Copy link
Member

Thanks for your first PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants