Discovery application for Emory's Cor repository.
-
Ruby version 2.7.5, Rails version 5.1
-
Blacklight 7
-
MySQL 5.7.22
- Install and start up MySQL 5.7
- Clone the git repo:
git clone git@github.com:emory-libraries/dlp-lux.git
cd ./dlp-lux
- Install the required gems:
bundle install
- Configure the MySQL development and test databases. This is accomplished by setting the environment variables that
database.yml
expects. In the root directory of the application, create a.env
file and add the lineDATABASE_USERNAME=root
. (By default, MySQL has the usernameroot
with no password.) Also create a.env.development
file and a.env.test
file and add the linesDATABASE_NAME=dlp-lux_development
andDATABASE_NAME=dlp-lux_test
, respectively. - In order to be able to sign into the application locally, the environment variable
DATABASE_AUTH=true
must be set in your development environment.
- You must create a user via the rails console:
bundle exec rails c
u = User.new
u.uid = "user"
u.display_name = "User Name"
u.email = "email@testdomain.com"
u.password = "password"
u.password_confirmation = "password"
u.save
- In order to see objects with a visibility of "Rose High View", your IP must match an address on the server in
config/reading_room_ips.yml
. See the existing file for the example setup. - Create and migrate the development database:
rails db:create db:migrate
- Create and migrate the test database:
RAILS_ENV=test rails db:create db:migrate
- Migrate the database:
rails db:migrate
- Install UV and any other JS dependencies:
yarn install
- Launch development instance of solr:
solr_wrapper
- Launch test instance of solr:
solr_wrapper --config config/solr_wrapper_test.yml
- Run the tests to ensure everything is working as expected:
rspec spec
- Launch a rails server:
rails server
- You should now be able to go to
http://localhost:3000
and see the application
- The
IIIF_MANIFEST_URL
environment variable needs to be set. This URL is the base URL for the Hyrax instance that serves the Work's IIIF manifest. An example:https://curate-qa.curationexperts.com/concern/curate_generic_works/
. - The
THUMBNAIL_URL
environment variable needs to be set. This URL is the base URL for the Hyrax instance that serves the Work's thumbnail images. An example:https://curate-qa.curationexperts.com
In order to prevent search engine crawling of the system before it's ready to launch, we use HTTP password protection. This is set via environment variables.
Set HTTP_PASSWORD_PROTECT='true'
to enable this feature.
Set HTTP_PASSWORD_PROTECT='false'
to disable this feature.
Set the login and password via environment variables HTTP_USERNAME
and HTTP_PASSWORD
- To deploy, first connect to the Emory VPN.
- run
tki
and receive your 12-hour AWS credentials. - run the following command:
AWS_PROFILE=tki-aws-account-70-rhedcloud/RHEDcloudAdministratorRole BRANCH=<tag> bundle exec cap <env> deploy
where <tag>
is either a version, like v0.4.32, or a branch, like master and
where <env>
is one of production, test, or arch.
- Run
rspec spec
to run the default test suite - To run only specific tests, include
- the directory, e.g.
rspec spec/system
, - or the path to the test, e.g.
rspec spec/system/search_catalog_spec.rb
, - or, if you want to be super specific, you can even add the line number the spec starts on at the beginning, e.g.
rspec spec/system/search_catalog_spec.rb:178
- Can also run with tags, e.g.
rspec spec --tag relevancy:true
- the directory, e.g.
- Run
PROD_LIKE_ENV=qa|test|arch|prod rake lux:relevancy
- This rake task takes a prod-like environment as a variable and runs specs to ensure that search and indexing of active data are running as expected.
- Before your announced testing time window:
- Install Apache Jmeter https://jmeter.apache.org/
- From the project jmeter directory, run jmeter in GUI mode (
jmeter
with no command-line arguments on unix-like systems). - Open
jmeter/blacklight.jmx
from the file menu. - In the
User Defined Variables
panel, set the values ofthreads
andloops
to 1 for initial smoke-test run. - Check that the server name in the
HTTP Request Defaults
matches the server you want to run against (digital.library.emory.edu
for production) - Add a username and password to the
HTTP Authorization Manager
if running against a system with HTTP basic auth in place. - "Save test plan as" and a temporary filename (blacklight-tmp.jmx for instance)
- Run jmeter from the command line, replacing "trialname" with an unused filename:
jmeter -n -t blacklight-tmp.jmx -l trialname.jtl -e -o report-trialname
- Look for "Err: 0 (0.00%)" in the jmeter output; if there were errors, troubleshoot those before continuing to load testing.
- During your announced testing time window:
- Re-open your temporary copy of the test plan in the jmeter GUI
- In the
User Defined Variables
panel, set the value ofthreads
to the initial number of simultaneous users you want to simulate, and the value ofloops
to the number of times you want each simulated user to run through the suite of pages. Save your changes. - Run jmeter from the command line, replacing "trialname" with a new unused filename:
jmeter -n -t blacklight-tmp.jmx -l trialname.jtl -e -o report-trialname
- Repeat the previous two steps for each level of load to be simulated.
- Install and run Apache Jmeter in GUI mode as above.
- Open
jmeter/smoke-test.jmx
from the file menu. - Add a username and password to the
HTTP Authorization Manager
if running against a system with HTTP basic auth in place. - Hit the green forward arrow to start the tests running.
- View the results in "View Results Tree" (green with a checkmark for successes, red with an x for failures)