From 0d16d7f3b45a0477cb086454766af78f537b1b6f Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Tue, 8 Mar 2016 19:39:53 +0000 Subject: [PATCH 1/8] updates travis to run all cukes including those that require net connects --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c67fc769..66e87080 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ rvm: - "2.2.2" script: - bundle exec rspec spec - - bundle exec cucumber features --tags ~@require_net_connect + - bundle exec cucumber features notifications: email: false slack: cs169dev:OPMf1tPzfO3a4gz6gGTOFV7w From 9a80ea48c6ae3c624136dfd8489b0e449136dd88 Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Tue, 8 Mar 2016 19:51:41 +0000 Subject: [PATCH 2/8] adds travis config to get github api token into .netrc to access private repos --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 66e87080..9dad34ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ sudo: false language: ruby rvm: - "2.2.2" +before_install: + - echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc script: - bundle exec rspec spec - bundle exec cucumber features From 9c06e12f05d1448356d7239ce9880bb8f8921b42 Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Thu, 10 Mar 2016 18:59:09 +0000 Subject: [PATCH 3/8] adds secure key directly --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9dad34ae..e64e4b0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,15 @@ sudo: false language: ruby rvm: - - "2.2.2" +- 2.2.2 before_install: - - echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc +- echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc script: - - bundle exec rspec spec - - bundle exec cucumber features +- bundle exec rspec spec +- bundle exec cucumber features notifications: email: false slack: cs169dev:OPMf1tPzfO3a4gz6gGTOFV7w +env: + global: + secure: YQ0zBnEYoANt1BdVIK14/3T0D3X6Zz5ygLN2etaqrP6gvF/IeUKk6/MBbhBX1cSTqLQqJv9C/ryVCjsa2yw6xpKhF81AX1HKsBwJAnktD/2FuvkFEx0u13xgCpICd6C+5SupwoXrAUqd0wQx5shn0ac0d1CIoz6GjHXaYlVBeNQ= From 052d7c4d6fef7474e95a0d524b7ee20045988d84 Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Mon, 14 Mar 2016 08:47:29 +0000 Subject: [PATCH 4/8] re-adds token after travis logout --org and travis login --org --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e64e4b0d..9bff0f80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ notifications: slack: cs169dev:OPMf1tPzfO3a4gz6gGTOFV7w env: global: - secure: YQ0zBnEYoANt1BdVIK14/3T0D3X6Zz5ygLN2etaqrP6gvF/IeUKk6/MBbhBX1cSTqLQqJv9C/ryVCjsa2yw6xpKhF81AX1HKsBwJAnktD/2FuvkFEx0u13xgCpICd6C+5SupwoXrAUqd0wQx5shn0ac0d1CIoz6GjHXaYlVBeNQ= + - secure: D3Zn9Lu8zFFe8cR/ADWJeFaoMv5uFUO2oEacJ8992+MfEoipPiMO6zHkOgnaBD1Elr6w1Qf+Fv87wXD3KICYcrHU8qosdBsYL6Hr8BwjXBuKlu7e4bYceMyJAzCN0V/8UFlcczBbmeaOVCGyqbnMHZr+xdmL8d7jKIvInhsVmS8= From 5b13cd7c4348a67095b4ea187f0d510622242a41 Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Mon, 14 Mar 2016 10:23:25 +0000 Subject: [PATCH 5/8] switches to https for accessing private repo --- features/support/zipped_submission.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/support/zipped_submission.json b/features/support/zipped_submission.json index ce243839..7004ce59 100644 --- a/features/support/zipped_submission.json +++ b/features/support/zipped_submission.json @@ -1 +1 @@ -{"content": "{\"xqueue_files\": \"{\\\"hw1.zip\\\": \\\"http://www.fakedownload.com/hw1.zip\\\"}\", \"xqueue_header\": \"{\\\"submission_id\\\": 729546, \\\"submission_key\\\": \\\"c682677d07bdea26755a5e966edd2982\\\"}\", \"xqueue_body\": \"{\\\"student_info\\\": \\\"{\\\\\\\"anonymous_student_id\\\\\\\": \\\\\\\"506af89a6181960fc69f47f1fbc8d708\\\\\\\", \\\\\\\"submission_time\\\\\\\": \\\\\\\"20000619185228\\\\\\\"}\\\", \\\"grader_payload\\\": \\\"{\\\\n \\\\\\\"assignment_name\\\\\\\": \\\\\\\"zipped-submission-test\\\\\\\",\\\\n \\\\\\\"assignment_spec_uri\\\\\\\": \\\\\\\"git@github.com:saasbook/hw-ruby-intro-ci.git\\\\\\\",\\\\n \\\\\\\"autograder_type\\\\\\\": \\\\\\\"RspecGrader\\\\\\\",\\\\n \\\\\\\"due_dates\\\\\\\": {\\\\\\\"2100-01-02\\\\\\\": 1.0, \\\\\\\"2100-01-03\\\\\\\": 0.75, \\\\\\\"2100-01-04\\\\\\\": 0.50, \\\\\\\"2100-01-05\\\\\\\": 0.25}\\\\n }\\\", \\\"student_response\\\": \\\"\\\"}\"}", "return_code": 0} \ No newline at end of file +{"content": "{\"xqueue_files\": \"{\\\"hw1.zip\\\": \\\"http://www.fakedownload.com/hw1.zip\\\"}\", \"xqueue_header\": \"{\\\"submission_id\\\": 729546, \\\"submission_key\\\": \\\"c682677d07bdea26755a5e966edd2982\\\"}\", \"xqueue_body\": \"{\\\"student_info\\\": \\\"{\\\\\\\"anonymous_student_id\\\\\\\": \\\\\\\"506af89a6181960fc69f47f1fbc8d708\\\\\\\", \\\\\\\"submission_time\\\\\\\": \\\\\\\"20000619185228\\\\\\\"}\\\", \\\"grader_payload\\\": \\\"{\\\\n \\\\\\\"assignment_name\\\\\\\": \\\\\\\"zipped-submission-test\\\\\\\",\\\\n \\\\\\\"assignment_spec_uri\\\\\\\": \\\\\\\"https://github.com/saasbook/hw-ruby-intro-ci\\\\\\\",\\\\n \\\\\\\"autograder_type\\\\\\\": \\\\\\\"RspecGrader\\\\\\\",\\\\n \\\\\\\"due_dates\\\\\\\": {\\\\\\\"2100-01-02\\\\\\\": 1.0, \\\\\\\"2100-01-03\\\\\\\": 0.75, \\\\\\\"2100-01-04\\\\\\\": 0.50, \\\\\\\"2100-01-05\\\\\\\": 0.25}\\\\n }\\\", \\\"student_response\\\": \\\"\\\"}\"}", "return_code": 0} \ No newline at end of file From 2902c2523736821e6ada19a2686ba35fd929dd4a Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Mon, 14 Mar 2016 13:11:18 +0000 Subject: [PATCH 6/8] changes to lazy approach for all URIs for git clone --- lib/assignment/xqueue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/assignment/xqueue.rb b/lib/assignment/xqueue.rb index 12b92af4..e481415e 100644 --- a/lib/assignment/xqueue.rb +++ b/lib/assignment/xqueue.rb @@ -50,7 +50,7 @@ def apply_lateness!(submission) def fetch_spec_file(spec_uri) file_path = "#{ENV['BASE_FOLDER']}#{@assignment_name}-spec" if not File.exist? file_path - if spec_uri.include? '.git' # lazy way of getting a git URI + if true # spec_uri.include? '.git' # lazy way of getting a git URI if system("git clone #{spec_uri} temp_repo") logger.debug("Download from repo spec file to: #{file_path}") spec_from_repo('temp_repo/autograder', file_path) From 674108f9deff3b0961cf2456bad0a6d59b55766b Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Mon, 14 Mar 2016 15:47:53 +0000 Subject: [PATCH 7/8] goes to a real connection for everything with git in it ... --- lib/assignment/xqueue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/assignment/xqueue.rb b/lib/assignment/xqueue.rb index e481415e..f7f322bb 100644 --- a/lib/assignment/xqueue.rb +++ b/lib/assignment/xqueue.rb @@ -50,7 +50,7 @@ def apply_lateness!(submission) def fetch_spec_file(spec_uri) file_path = "#{ENV['BASE_FOLDER']}#{@assignment_name}-spec" if not File.exist? file_path - if true # spec_uri.include? '.git' # lazy way of getting a git URI + if spec_uri.include? 'git' # lazy way of getting a git URI if system("git clone #{spec_uri} temp_repo") logger.debug("Download from repo spec file to: #{file_path}") spec_from_repo('temp_repo/autograder', file_path) From e7f35f30d940b5edcc1b902a28cc186716142c4d Mon Sep 17 00:00:00 2001 From: Sam Joseph Date: Mon, 14 Mar 2016 16:17:05 +0000 Subject: [PATCH 8/8] adjusts spec uri to use system call for https requests to git too --- lib/assignment/xqueue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/assignment/xqueue.rb b/lib/assignment/xqueue.rb index 6339939e..b8084e02 100644 --- a/lib/assignment/xqueue.rb +++ b/lib/assignment/xqueue.rb @@ -56,7 +56,7 @@ def file_time_in_days(file_name) def fetch_spec_file(spec_uri) file_path = "#{ENV['BASE_FOLDER']}#{@assignment_name}-spec" if not File.exist? file_path or file_time_in_days(file_path) > 1 # Expire a solution repo if > 1 day old - if spec_uri.include? '.git' # lazy way of getting a git URI + if spec_uri.include? 'git' # lazy way of getting a git URI if system("git clone #{spec_uri} temp_repo") logger.debug("Download from repo spec file to: #{file_path}") spec_from_repo('temp_repo/autograder', file_path)