Преглед изворни кода

Merge pull request #238 from smiclea/github-action

Add GitHub Workflow action for unit test running
Daniel Vincze пре 3 година
родитељ
комит
354fb63433
2 измењених фајлова са 28 додато и 1 уклоњено
  1. 27 0
      .github/workflows/unit-tests.yml
  2. 1 1
      coriolis/tests/conductor/rpc/test_server.py

+ 27 - 0
.github/workflows/unit-tests.yml

@@ -0,0 +1,27 @@
+name: Coriolis Unit Tests
+
+on:
+  workflow_dispatch:
+  pull_request:
+    branches: [ "master" ]
+
+permissions:
+  contents: read
+
+jobs:
+  build:
+
+    runs-on: ubuntu-20.04
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Install dependencies
+      run: |
+        sudo apt install python3-nose
+        sudo apt install libmysqlclient-dev
+
+        pip install -r requirements.txt
+        pip install -r test-requirements.txt
+    - name: Run unit tests
+      run: |
+        nosetests3 -v --nocapture --logging-level=ERROR coriolis/tests/

+ 1 - 1
coriolis/tests/conductor/rpc/test_server.py

@@ -37,7 +37,7 @@ class ConductorServerEndpointTestCase(test_base.CoriolisBaseTestCase):
                           self.server, mock.sentinel.context, mock.sentinel.replica_id)
 
         mock_get_replica.assert_called_once_with(mock.sentinel.context,
-                                                 mock.sentinel.replica_id)
+                                                 mock.sentinel.replica_id, include_task_info=True)
         mock_check_replica_running.assert_called_once_with(
             mock.sentinel.context, mock_replica)
         mock_create_task.assert_not_called()