forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add UI tests infrastructure and Github action (#377)
* add test CI * add ontologies controller tests
- Loading branch information
1 parent
c00e115
commit c1a1d4b
Showing
9 changed files
with
299 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | ||
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | ||
name: "Ruby on Rails CI" | ||
|
||
on: | ||
push: | ||
pull_request_target: | ||
types: [ opened, reopened ] | ||
env: | ||
API_URL: ${{ secrets.API_URL }} | ||
API_KEY: ${{ secrets.API_KEY }} | ||
BIOMIXER_URL: ${{ secrets.BIOMIXER_URL }} | ||
FAIRNESS_URL: ${{ secrets.FAIRNESS_URL }} | ||
ANNOTATOR_URL: ${{ secrets.ANNOTATOR_URL }} | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
mysql: | ||
image: mysql:latest | ||
ports: | ||
- "3306:3306" | ||
env: | ||
MYSQL_ROOT_PASSWORD: 'bp_user' | ||
memcached: | ||
image: memcached:1.6 | ||
ports: | ||
- 11211:11211 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# Add or replace dependency steps here | ||
- name: Install Ruby and gems | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.8 | ||
bundler-cache: true | ||
# Add or replace database setup steps here | ||
- name: set up config file | ||
run: cp config/database.yml.sample config/database.yml | ||
- name: Set up database schema | ||
run: RAILS_ENV=test bin/rails db:setup | ||
- name: Set up yarn | ||
run: yarn install | ||
# Add or replace test runners here | ||
- name: Run tests | ||
run: RAILS_ENV=test bin/rails test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
# frozen_string_literal: true | ||
|
||
$SITE = 'Testportal' | ||
$UI_HOSTNAME = 'localhost' | ||
$UI_URL = "http://#{$UI_HOSTNAME}:3000" | ||
|
||
$API_KEY = ENV['API_KEY'] | ||
$REST_URL = ENV['API_URL'] | ||
$BIOMIXER_URL = ENV['BIOMIXER_URL'] | ||
$ANNOTATOR_URL = $PROXY_URL = ENV['ANNOTATOR_URL'] | ||
$FAIRNESS_URL = ENV['ANNOTATOR_URL'] | ||
|
||
# config/initializers/omniauth_providers.rb | ||
$OMNIAUTH_PROVIDERS = { | ||
github: { | ||
client_id: 'id', | ||
client_secret: 'secret', | ||
icon: 'icons/github.svg' | ||
}, | ||
google: { | ||
strategy: :google_oauth2, | ||
client_id: 'id', | ||
client_secret: 'secret', | ||
icon: 'icons/google.svg' | ||
}, | ||
orcid: { | ||
client_id: 'YOUR_ORCID_CLIENT_ID', | ||
client_secret: 'YOUR_ORCID_CLIENT_SECRET', | ||
icon: 'icons/orcid.svg' | ||
}, | ||
keycloak: { | ||
strategy: :keycloak_openid, | ||
client_id: 'YOUR_KEYCLOAK_CLIENT_ID', | ||
client_secret: 'YOUR_KEYCLOAK_CLIENT_SECRET', | ||
client_options: { site: 'KEYCLOAK_SITE', realm: 'KEYCLOAK_REALM' }, | ||
name: 'keycloak', | ||
icon: 'icons/keycloak.svg' | ||
} | ||
}.freeze | ||
|
||
$INTERPORTAL_HASH = {} | ||
|
||
# If your BioPortal installation includes Fairness score set this to true | ||
$FAIRNESS_DISABLED = false | ||
|
||
# Pairing a name with an array of ontology virtual ids will allow you to filter ontologies based on a subdomain. | ||
# If your main UI is hosted at example.org and you add custom.example.org pointing to the same Rails installation | ||
# you could filter the ontologies visible at custom.example.org by adding this to the hash: "custom" => { :name => "Custom Slice", :ontologies => [1032, 1054, 1099] } | ||
# Any number of slices can be added. Groups are added automatically using the group acronym as the subdomain. | ||
$ENABLE_SLICES = true | ||
$ONTOLOGY_SLICES = {} | ||
|
||
# Cube metrics reporting | ||
$ENABLE_CUBE = false | ||
|
||
$NOT_DOWNLOADABLE = {} | ||
# Enable client request caching | ||
$CLIENT_REQUEST_CACHING = true | ||
|
||
# If you don't use Airbrake you can have exceptions emailed to the $ERROR_EMAIL address by setting this to 'true' | ||
$EMAIL_EXCEPTIONS = false | ||
|
||
# Announcements mailman mailing list REQUEST address, EX: [email protected] | ||
# NOTE: You must use the REQUEST address for the mailing list. ONLY WORKS WITH MAILMAN LISTS. | ||
$ANNOUNCE_LIST ||= 'appliance-users-request@localhost' | ||
|
||
# Email addresses used for sending notifications (errors, feedback, support) | ||
$SUPPORT_EMAIL ||= 'support@localhost' | ||
$ADMIN_EMAIL ||= 'admin@localhost' | ||
$ERROR_EMAIL ||= 'errors@localhost' | ||
|
||
# Custom BioPortal logging | ||
require 'log' | ||
$REMOTE_LOGGING = false | ||
|
||
## | ||
# Custom Ontology Details | ||
# Custom details can be added on a per ontology basis using a key/value pair as columns of the details table | ||
# | ||
# Example: | ||
# $ADDITIONAL_ONTOLOGY_DETAILS = { 1000 => { "Additional Detail" => "Text to be shown in the right-hand column." } } | ||
## | ||
$ADDITIONAL_ONTOLOGY_DETAILS = {} | ||
|
||
# Site notice appears on all pages and remains closed indefinitely. Stored below as a hash with a unique key and a | ||
# EX: $SITE_NOTICE = { :unique_key => 'Put your message here (can include <a href="/link">html</a> if you use | ||
$SITE_NOTICE = {} | ||
################################ | ||
## AUTO-GENERATED DO NOT MODIFY | ||
################################# | ||
|
||
# Full string for site, EX: "NCBO BioPortal" | ||
$ORG_SITE = $ORG.nil? || $ORG.empty? ? $SITE : "#{$ORG} #{$SITE}" | ||
|
||
$HOME_PAGE_LOGOS = { | ||
supported_by: [ | ||
{ | ||
img_src: 'logos/supports/numev.png', | ||
url: 'http://www.lirmm.fr/numev', | ||
target: '_blank' | ||
}, | ||
{ | ||
img_src: 'logos/supports/anr.png', | ||
url: 'https://anr.fr/en', | ||
target: '_blank' | ||
}, | ||
{ | ||
img_src: 'logos/supports/eu.png', | ||
url: 'https://commission.europa.eu/research-and-innovation_en', | ||
target: '_blank' | ||
} | ||
], | ||
with_the_collaboration_of: [ | ||
{ | ||
img_src: 'logos/collaboration/d2kab.png', | ||
url: 'http://d2kab.mystrikingly.com', | ||
target: '_blank' | ||
}, | ||
{ | ||
img_src: 'logos/collaboration/lirmm.png', | ||
url: 'http://www.lirmm.fr', | ||
target: '_blank' | ||
}, | ||
{ | ||
img_src: 'logos/collaboration/inrae.png', | ||
url: 'https://www.inrae.fr/enm', | ||
target: '_blank' | ||
}, | ||
{ | ||
img_src: 'logos/collaboration/stanford.png', | ||
url: 'https://www.stanford.edu', | ||
target: '_blank' | ||
} | ||
] | ||
} | ||
|
||
$FOOTER_LINKS = { | ||
social: [ | ||
{ logo: 'social/people.svg', link: 'https://github.com/orgs/agroportal/people' }, | ||
{ logo: 'social/github.svg', link: 'https://github.com/agroportal' }, | ||
{ logo: 'social/twitter.svg', link: 'https://twitter.com/lagroportal' } | ||
], | ||
sections: { | ||
products: { | ||
ontoportal: 'https://ontoportal.org/', | ||
release_notes: 'https://doc.jonquetlab.lirmm.fr/share/e6158eda-c109-4385-852c-51a42de9a412/doc/release-notes-btKjZk5tU2', | ||
api: 'https://data.agroportal.lirmm.fr/', | ||
sparql: 'https://sparql.agroportal.lirmm.fr/test/' | ||
}, | ||
support: { | ||
contact_us: 'https://agroportal.lirmm.fr/feedback', | ||
wiki: 'https://www.bioontology.org/wiki/', | ||
documentation: 'https://ontoportal.github.io/documentation/' | ||
}, | ||
agreements: { | ||
terms: '', | ||
privacy_policy: '', | ||
cite_us: '', | ||
acknowledgments: '' | ||
}, | ||
about: { | ||
about_us: 'https://github.com/agroportal/project-management', | ||
projects: 'https://d2kab.mystrikingly.com/', | ||
team: 'https://github.com/orgs/agroportal/people' | ||
} | ||
} | ||
} | ||
|
||
$UI_THEME = :stageportal | ||
if File.exist?('config/bioportal_config_development_testportal.lirmm.fr.rb') | ||
require_relative 'bioportal_config_development_testportal.lirmm.fr' # local credentials | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
class ApplicationControllerTest < ActionDispatch::IntegrationTest | ||
test 'should show home page' do | ||
get '' | ||
assert_response :success | ||
end | ||
|
||
test 'should show projects page' do | ||
get '/projects' | ||
assert_response :success | ||
end | ||
|
||
test 'should show annotator page' do | ||
get '/annotator' | ||
assert_response :success | ||
end | ||
|
||
test 'should show recommender page' do | ||
get '/recommender' | ||
assert_response :success | ||
end | ||
|
||
test 'should show mapping page' do | ||
get '/mappings' | ||
assert_response :success | ||
end | ||
|
||
test 'should show feedback page' do | ||
get '/feedback' | ||
assert_response :success | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
class LandscapeControllerTest < ActionController::TestCase | ||
test "should get index" do | ||
test 'should get index' do | ||
skip('take too much time') | ||
get :index | ||
assert_response :success | ||
end | ||
|
||
end |
Oops, something went wrong.