|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support documentation. |
| 4 | +# This workflow will download a prebuilt Python version, install dependencies and run integration tests |
| 5 | + |
| 6 | +name: Run Integration Tests |
| 7 | + |
| 8 | +on: |
| 9 | + |
| 10 | + # Allows you to run this workflow manually from the Actions tab |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +jobs: |
| 14 | + integration_test: |
| 15 | + name: Build and Run Integration Tests on Python ${{ matrix.python-version }} and ${{ matrix.os }} |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + python-version: ['3.8'] |
| 20 | + os: [ubuntu-latest] |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v2 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + |
| 30 | + - name: Install Python dependencies (ubuntu) |
| 31 | + run: | |
| 32 | + pip3 install -r requirements.txt |
| 33 | + pip3 install -r requirements-dev.txt |
| 34 | + pip3 install --editable . |
| 35 | +
|
| 36 | + - name: Execute Python integration tests |
| 37 | + # continue-on-error: true |
| 38 | + env: |
| 39 | + NATURAL_LANGUAGE_CLASSIFIER_URL: "https://api.us-south.natural-language-classifier.watson.cloud.ibm.com" |
| 40 | + NATURAL_LANGUAGE_CLASSIFIER_APIKEY: ${{ secrets.NLC_APIKEY }} |
| 41 | + LANGUAGE_TRANSLATOR_APIKEY: ${{ secrets.LT_APIKEY }} |
| 42 | + LANGUAGE_TRANSLATOR_URL: "https://api.us-south.language-translator.watson.cloud.ibm.com" |
| 43 | + NATURAL_LANGUAGE_UNDERSTANDING_APIKEY: ${{ secrets.NLU_APIKEY }} |
| 44 | + NATURAL_LANGUAGE_UNDERSTANDING_URL: "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com" |
| 45 | + PERSONALITY_INSIGHTS_APIKEY: ${{ secrets.PI_APIKEY }} |
| 46 | + PERSONALITY_INSIGHTS_URL: "https://api.us-south.personality-insights.watson.cloud.ibm.com" |
| 47 | + TONE_ANALYZER_APIKEY: ${{ secrets.TA_APIKEY }} |
| 48 | + TONE_ANALYZER_URL: "https://api.us-south.tone-analyzer.watson.cloud.ibm.com" |
| 49 | + SPEECH_TO_TEXT_APIKEY: ${{ secrets.STT_APIKEY }} |
| 50 | + SPEECH_TO_TEXT_URL: "https://api.us-south.speech-to-text.watson.cloud.ibm.com" |
| 51 | + TEXT_TO_SPEECH_APIKEY: ${{ secrets.TTS_APIKEY }} |
| 52 | + TEXT_TO_SPEECH_URL: "https://api.us-south.text-to-speech.watson.cloud.ibm.com" |
| 53 | + VISUAL_RECOGNITION_APIKEY: ${{ secrets.VR_APIKEY }} |
| 54 | + VISUAL_RECOGNITION_COLLECTION_ID: ${{ secrets.VR_COLLECTION_ID }} |
| 55 | + VISUAL_RECOGNITION_URL: "https://api.us-south.visual-recognition.watson.cloud.ibm.com" |
| 56 | + COMPARE_COMPLY_APIKEY: ${{ secrets.CC_APIKEY }} |
| 57 | + COMPARE_COMPLY_FEEDBACK_ID: ${{ secrets.CC_FEEDBACK_ID }} |
| 58 | + COMPARE_COMPLY_URL: "https://api.us-south.compare-comply.watson.cloud.ibm.com" |
| 59 | + ASSISTANT_APIKEY: ${{ secrets.WA_APIKEY }} |
| 60 | + ASSISTANT_WORKSPACE_ID: ${{ secrets.WA_WORKSPACE_ID }} |
| 61 | + ASSISTANT_ASSISTANT_ID: ${{ secrets.WA_ASSISTANT_ID }} |
| 62 | + ASSISTANT_URL: "https://api.us-south.assistant.watson.cloud.ibm.com" |
| 63 | + DISCOVERY_APIKEY: ${{ secrets.D1_APIKEY }} |
| 64 | + DISCOVERY_ENVIRONMENT_ID: ${{ secrets.D1_ENVIRONMENT_ID }} |
| 65 | + DISCOVERY_COLLECTION_ID: ${{ secrets.D1_COLLECTION_ID }} |
| 66 | + DISCOVERY_URL: "https://api.us-south.discovery.watson.cloud.ibm.com" |
| 67 | + DISCOVERY_V2_APIKEY: ${{ secrets.D2_APIKEY }} |
| 68 | + DISCOVERY_V2_PROJECT_ID: ${{ secrets.D2_PROJECT_ID }} |
| 69 | + DISCOVERY_V2_COLLECTION_ID: ${{ secrets.D2_COLLECTION_ID }} |
| 70 | + DISCOVERY_V2_URL: "https://api.us-south.discovery.watson.cloud.ibm.com" |
| 71 | + run: | |
| 72 | + pip3 install -U python-dotenv |
| 73 | + pytest test/integration/test_assistant_v1.py -rap |
| 74 | + pytest test/integration/test_compare_comply_v1.py -rap |
| 75 | + pytest test/integration/test_discovery_v1.py -rap |
| 76 | + pytest test/integration/test_discovery_v2.py -rap |
| 77 | + pytest test/integration/test_language_translator_v3.py -rap |
| 78 | + pytest test/integration/test_natural_language_classifier_v1.py -rap |
| 79 | + pytest test/integration/test_natural_language_understanding_v1.py -rap |
| 80 | + pytest test/integration/test_personality_insights_v3.py -rap |
| 81 | + pytest test/integration/test_speech_to_text_v1.py -rap |
| 82 | + pytest test/integration/test_text_to_speech_v1.py -rap |
| 83 | + pytest test/integration/test_tone_analyzer_v3.py -rap |
| 84 | + pytest test/integration/test_visual_recognition_v3.py -rap |
| 85 | + pytest test/integration/test_visual_recognition_v4.py -rap |
| 86 | +
|
| 87 | + # Do not notify on success. We will leave the code here just in case we decide to switch gears |
| 88 | + - name: Notify slack on success |
| 89 | + if: false # success() |
| 90 | + env: |
| 91 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} |
| 92 | + uses: voxmedia/github-action-slack-notify-build@v1 |
| 93 | + with: |
| 94 | + channel: watson-e2e-tests |
| 95 | + status: SUCCESS |
| 96 | + color: good |
| 97 | + |
| 98 | + - name: Notify slack on failure |
| 99 | + if: false # failure() |
| 100 | + env: |
| 101 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} |
| 102 | + uses: voxmedia/github-action-slack-notify-build@v1 |
| 103 | + with: |
| 104 | + channel: watson-e2e-tests |
| 105 | + status: FAILED |
| 106 | + color: danger |
0 commit comments