GSOC Project : Improving RubyBench

I am now using environment variables for both github api and password in the code to create an issue. But the problem is how do I pass travis ci tests?
I tried the following :
I can set a github password and use it in my tests to create an issue for the first time in vcr and then record this in cassette. Now I can change the original password and recorded http request will be sent via vcr to pass my tests. But what about the github api? If I provide the github api as an environment variable, how can the test environment know that?
Please help me out.

@shahsaurabh0605 We can follow same approach followed here GitHub - octokit/octokit.rb: Ruby toolkit for the GitHub API

Please go through it and see how we can use same approach.

Perhaps you can read through https://www.relishapp.com/vcr/vcr/v/1-7-1/docs/test-frameworks/usage-with-test-unit?

@system I went through this already. I have surrounded my tests with vcr cassette.
The problem is say I set my github_pass:'abcde' in secrets.yml, which is my original github password and run the tests. Tests will pass and send the post request to create an issue. Afterwards, whenever I run the tests post request wonā€™t be created and just the recorded cassette will pass the tests. But I canā€™t keep my password in test environment and I just set it arbitary github_pass:'12345'. Now when I run the tests vcr will give me VCR::Errors::UnhandledHTTPRequestError: because the post request got changed and it wonā€™t just play the recording again. This is what is happening here, Rails.application.secrets.github_password fetches different password and vcr canā€™t handle it.

@prathamesh As far as I understand from that link we can set environment variables in travis. We can set github api and encrypted password in either repository settings or .travis.yml file. Not sure, but I think that should work :slight_smile:

@prathamesh @system
I modified the PR to use secure environment variables in .travis.yml. Have a look at it. However such secure env variables cannot be set by pull requests from forks. So I think you need to set this.

You wonā€™t have to hit the API in TravisCI if you check in the cassettes. Iā€™m not sure why I added the cassettes files to .gitignore but itā€™ll be worth a relook

@shahsaurabh0605 The PR is finally looking good. What is next on your list?

Itā€™s huge relief to see that the PR is on the verge of completion :grin: It will be great if you assign me the next task :slight_smile:

Sure Iā€™ll like to have an admin panel where we can run our benchmarks manually :slight_smile: Basically, a way to run methods in ruby-bench-web/remote_server_job.rb at master Ā· ruby-bench/ruby-bench-web Ā· GitHub

Currently there is a admin controller but it only redirects us to the home page. What do we exactly require here?

Say, we can create admin page where we can ask inputs for benchmarking methods and fetch suitable results.

1 Like

Opps sorry I missed this. Yea we need an admin page to allow an admin to trigger benchmarks. Donā€™t worry about users account for now.

Basically you have a form for users to choose which benchmark they want to run and the commit/version to run the benchmark for. Focus on being able to run all benchmarks for a single repo first before we drill down further and allow benchmark types to be selected.

Also, we need to allow them to backfill benchmarks within a range of dates.

@system @prathamesh You must have had a look at Google Work Submission Guidelines mail. I wanted to know how do I submit the complete work? There are many commits which are merged and some of them unmerged with a little work remaining. I can make a blog post clearly mentioning the work done uptill now and giving proper links. Opinions?

And yeah, have a look at the github addition on admin panel. :slight_smile:

1 Like

You can link directly to the commits and pull requests. Other than that, there isnā€™t anything special we need from our end.

As far as I can tell, the admin interface PR isnā€™t complete so Iā€™m donā€™t think reviewing it now will be meaningful.

OK. I will create a blog with all the links to commits and pull requests with short description where ever needed and show it to you. Other than that if you want then we can still complete the admin PR interface even if it exceeds the time.

1 Like

Do you have an existing blog? If not, I think a gist on GitHub will work fine :slight_smile:

1 Like

I wrote this blog for final submissions in GSoC. You can have a look and I will submit it on the website.

1 Like

Great, please submit it on the GSOC website as 23rd August is last date.

2 Likes