From a67e18505e388569344552752f54f2d82897e389 Mon Sep 17 00:00:00 2001 From: "epugh@opensourceconnections.com" <> Date: Tue, 1 Dec 2020 14:31:49 -0500 Subject: [PATCH] fix the case name to show up --- Gemfile.lock | 8 ++++---- README.md | 15 ++++++++++----- agent_q.gemspec | 4 ++-- lib/agent_q.rb | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 451d636..c3099de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - agent_q (0.0.12) + agent_q (0.0.13) capybara (~> 3.31, >= 3.31) cuprite (~> 0.11, >= 0.11) nokogiri (~> 1.10, >= 1.10.8) @@ -11,7 +11,7 @@ GEM specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - capybara (3.33.0) + capybara (3.34.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -33,11 +33,11 @@ GEM mini_portile2 (2.4.0) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) - public_suffix (4.0.5) + public_suffix (4.0.6) rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) - regexp_parser (1.7.1) + regexp_parser (1.8.2) websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) diff --git a/README.md b/README.md index 37982af..3eda777 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,13 @@ AgentQ lets you automate your test driven relevancy cases via [Quepid](http://www.quepid.com). Easily integrate testing your Solr or Elasticsearch search engine into your CI or Continuous Deployment pipeline. Be confident that you have highly relevant search results without the manual testing! -Run a Quepid case automatically from the command line by passing in a case number (`1139`) and the score threshold for deciding if your search results pass or fail (`10`): +Run a Quepid case automatically from the command line by passing in a case number (`4081`) and the score threshold for deciding if your search results pass or fail (`10`): ```sh -> agent_q 1139 10 epugh@opensourceconnections.com $QUEPID_PASSWORD http://app.quepid.com +> export QUEPID_PASSWORD=your_password +> agent_q 4081 10 epugh@opensourceconnections.com $QUEPID_PASSWORD http://app.quepid.com -Case o19s blog search (1139) scored 10.0, which meets the threshold of 10 +Case o19s blog search (778) scored 10.0, which meets the threshold of 10 ``` If the Q Score for the case meets the threshold, then AgentQ will return 0, otherwise it returns 1, which signifies to your CI system that there was a failure. @@ -30,9 +31,13 @@ and then call AgentQ from CircleCI via this line in our `circle.yml` file: test: override: - bundle exec jekyll build - - bundle exec agent_q 1139 75 $QUEPID_USER $QUEPID_PASSWORD http://app.quepid.com + - bundle exec agent_q 4081 10 $QUEPID_USER $QUEPID_PASSWORD http://app.quepid.com ``` +## How to test the code + +Just run the code locally via `./bin/agent_q` + ## Updating the Gem Read up on how to manage gems at https://guides.rubygems.org/make-your-own-gem/. @@ -41,7 +46,7 @@ Read up on how to manage gems at https://guides.rubygems.org/make-your-own-gem/. bundle install gem build agent_q.gemspec gem install ./agent_q-0.0.12.gem -agent_q 1139 10 epugh@opensourceconnections.com $QUEPID_PASSWORD http://app.quepid.com +agent_q 4081 10 epugh@opensourceconnections.com $QUEPID_PASSWORD http://app.quepid.com ``` To deploy to RubyGems: diff --git a/agent_q.gemspec b/agent_q.gemspec index e54d05d..622a09f 100644 --- a/agent_q.gemspec +++ b/agent_q.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'agent_q' - s.version = '0.0.12' - s.date = '2020-08-11' + s.version = '0.0.13' + s.date = '2020-12-01' s.summary = "Headless agent for test driven relevancy with Quepid.com" s.description = "A ruby agent that wraps a head browser that runs a specific Quepid Case and returns if your relevancy score meets or falls below a threshold." s.authors = ["Eric Pugh"] diff --git a/lib/agent_q.rb b/lib/agent_q.rb index d0a70eb..a95b44e 100755 --- a/lib/agent_q.rb +++ b/lib/agent_q.rb @@ -52,7 +52,7 @@ def run html = page.html json = html[html.index('{')..html.rindex('}')] case_details = JSON.parse(json) - case_name = case_details["caseName"] + case_name = case_details["case_name"] if case_results['message'] puts "Error checking case #{@quepid_case}: #{case_results['message']}"