Skip to content

Latest commit

 

History

History
110 lines (82 loc) · 4.66 KB

README.md

File metadata and controls

110 lines (82 loc) · 4.66 KB

Ruby Installation for Integration Verification Tests (IVT)

  1. (Mac OS Env) Install homebrew: https://brew.sh/

  2. Install GNU Privacy Guard

    brew install gnupg gnupg2

    NOTE: This is dependent on Homebrew to be completely installed first.

  3. Install Ruby

    Directions here: https://rvm.io/rvm/install. Be sure to install RVM stable with ruby. You only need to follow Install GPG keys and Install RVM stable with ruby.

  4. Ensure you can call rvm

    rvm list
  5. If ruby-2.6.5 is not listed in the script response above, run these install commands:

    rvm install ruby-2.6.5
    rvm use --default ruby-2.6.5
    gem install bundler
  6. Run this script in the terminal in the same directory as Gemfile

    bundle install

    NOTE: Ensure gem install bundler completed first. It should exit with code 0 at the end.

  7. (Optional) If running in IntelliJ, configure this project as an RVM Ruby project:

    • Install the Ruby plugin: IntelliJ IDEA > Preferences... > Plugins
    • Configure Project: File > Project Structure > Project Settings > Project and select RVM: ruby-2.6.5.
    • Configure Module: File > Project Structure > Project Settings > Modules and reconfigure module with RVM Ruby.

    NOTE: Ensure that your Ruby versions match across terminal default, Gemfile, and Gemfile.lock. If using IntelliJ, the Ruby version in your module should match as well.

  8. (Optional) To run tests locally, export these environment variables. Most of the values can be found in .github/workflows/ci-workflow.yml, with exceptions noted below.:

    • Export these environment variables:

      • KAFKA_BROKERS
      • ELASTIC_URL
      • ELASTIC_USER
      • ELASTIC_PASSWORD - password for your ElasticSearch instance service credential
      • CLOUD_API_KEY - found in your password manager
      • SASL_PLAIN_PASSWORD - password for your Event Streams instance service credential
      • FLINK_URL
      • APPID_TENANT
      • APPID_URL
      • OIDC_HRI_INTERNAL_CLIENT_ID
      • OIDC_HRI_INTERNAL_CLIENT_SECRET - secret field for your HRI internal application in AppId
      • OIDC_HRI_DATA_INTEGRATOR_CLIENT_ID
      • OIDC_HRI_DATA_INTEGRATOR_CLIENT_SECRET - secret field for your HRI data integrator application in AppId
      • APPID_HRI_AUDIENCE
      • APPID_FLINK_AUDIENCE
      • INPUT_TOPIC
      • OUTPUT_TOPIC
      • NOTIFICATION_TOPIC
      • INVALID_TOPIC
      • HRI_INGRESS_URL
      • HRI_SERVICE_URL
      • BRANCH_NAME - your git branch name
    • Install the IBM Cloud CLI and the Event Streams CLI. You can find the RESOURCE_GROUP in .github/workflows/ci-workflow.yml and the CLOUD_API_KEY in your password manager:

          curl -sL https://ibm.biz/idt-installer | bash
          bx login --apikey {CLOUD_API_KEY}
          bx target -g {RESOURCE_GROUP}
          bx plugin install event-streams
          bx es init

      Then select the number corresponding to the KAFKA_INSTANCE in .github/workflows/ci-workflow.yml.

    • Clone the hri-flink-pipeline-core repo (https://github.com/Alvearie/hri-flink-pipeline-core), then run the following command in that directory:

      ./gradlew publishToMavenLocal

      When that completes, run the following command in the hri-flink-validation-fhir directory:

      ./gradlew clean build shadowJar --refresh-dependencies

    • The last step before running the tests is to install the hri-test-helpers gem locally. Run the following commands:

         gem install specific_install
         gem specific_install -l [email protected]/Alvearie/hri-test-helpers.git -b master

      Then, add the following line to Gemfile, but do not commit this change to Github: gem 'hri-test-helpers

    • From within the top directory of this project, run the integration tests with:
      rspec test/spec --tag ~@broken

      To run the High Availability tests, run the following command: rspec test/nightly/flink_validation_fhir_high_availability_spec.rb --tag ~@broken

      The load test requires a bucket of auto-generated, large fhir records. The following command generates the records in the test/test_data/synthea directory. java -jar test/dependencies/synthea-with-dependencies.jar -p 100 -c test/test_data/synthea.properties

      Alternatively, you can use the generateSyntheaRecords gradle task to generate the records independently.

      When the records are generated, run the load test with the following command: rspec test/nightly/flink_validation_fhir_load_test_spec.rb --tag ~@broken