Skip to content

Commit

Permalink
add test UI against a remote api CI
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 16, 2023
1 parent 5140fe5 commit 3726e84
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/tests-real-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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: "Run remote API tests 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 }}
DB_HOST: 127.0.0.1
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
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 test/controllers/* -v
4 changes: 2 additions & 2 deletions config/database.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ default: &default
adapter: mysql2
encoding: utf8mb4
username: root
password: bp_user
host: 127.0.0.1
password: root
host: <%= ENV["DB_HOST"] %>

development:
<<: *default
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/ontologies_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class OntologiesControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end

ONTOLOGIES.sample(5).flat_map { |ont| PAGES.map { |page| [ont, page] } }.each do |ont, page|
ONTOLOGIES.flat_map { |ont| PAGES.map { |page| [ont, page] } }.each do |ont, page|
test "should get page #{page} of #{ont.acronym} ontology" do
path = "#{ontologies_path}/#{ont.acronym}?p=#{page}"
get path
Expand Down

0 comments on commit 3726e84

Please sign in to comment.