From cd113c32737ce5fded9f9431ca1a0b4178585c3e Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Sun, 29 Nov 2020 20:28:02 -0800 Subject: [PATCH 01/18] Adding gh workflow for running tox unit tests --- .github/workflows/UnitTesting.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/UnitTesting.yaml diff --git a/.github/workflows/UnitTesting.yaml b/.github/workflows/UnitTesting.yaml new file mode 100644 index 00000000..4f34c5f6 --- /dev/null +++ b/.github/workflows/UnitTesting.yaml @@ -0,0 +1,24 @@ +name: Unit Testing +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Install tox + run: pip install tox + + - name: Run tests + run: tox -e py From 94ce1b9075a815f913c9a14b47fd2a2a86921b41 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Sun, 29 Nov 2020 21:09:59 -0800 Subject: [PATCH 02/18] testing with tox-gh-actions plugin --- .github/workflows/UnitTesting.yaml | 10 ++++++---- tox.ini | 9 +++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/UnitTesting.yaml b/.github/workflows/UnitTesting.yaml index 4f34c5f6..252df37b 100644 --- a/.github/workflows/UnitTesting.yaml +++ b/.github/workflows/UnitTesting.yaml @@ -17,8 +17,10 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install tox - run: pip install tox + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions - - name: Run tests - run: tox -e py + - name: Run tests with Tox + run: tox diff --git a/tox.ini b/tox.ini index f314bab2..e7f7d3de 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,15 @@ envlist = py{36,37,38}-django31 coverage-report +[gh-actions] +python = + 2.7: py27 + 3.4: py34 + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + skip_missing_interpreters = True [testenv] From a6cb4ccf89c772b58fec409acd2e2a5f02339042 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Sun, 29 Nov 2020 21:17:52 -0800 Subject: [PATCH 03/18] Removing py3.4 since tox-gh-actions is not available for it --- .github/workflows/UnitTesting.yaml | 2 +- tox.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/UnitTesting.yaml b/.github/workflows/UnitTesting.yaml index 252df37b..ba3eb03e 100644 --- a/.github/workflows/UnitTesting.yaml +++ b/.github/workflows/UnitTesting.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] + python: [2.7, 3.5, 3.6, 3.7, 3.8] steps: - name: Checkout repo diff --git a/tox.ini b/tox.ini index e7f7d3de..bcded74a 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,6 @@ envlist = [gh-actions] python = 2.7: py27 - 3.4: py34 3.5: py35 3.6: py36 3.7: py37 From 367f121def5c972a1cc4d5372d3b76d2988707fc Mon Sep 17 00:00:00 2001 From: Prashant Srivastava <50466688+srprash@users.noreply.github.com> Date: Mon, 30 Nov 2020 19:15:25 -0800 Subject: [PATCH 04/18] Adding Github to passenv --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index bcded74a..90892984 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ python = skip_missing_interpreters = True [testenv] -passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_* +passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_* GITHUB_* deps = pytest > 3.0.0 coverage==4.5.4 From f0c2e3bedfbb3d3ea953aa6828f6e2e04acf1b6c Mon Sep 17 00:00:00 2001 From: Prashant Srivastava <50466688+srprash@users.noreply.github.com> Date: Mon, 30 Nov 2020 19:22:32 -0800 Subject: [PATCH 05/18] Deliberately failing a test to validate the GH action --- tests/test_plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 032bde72..de44e63d 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -29,7 +29,7 @@ def test_ec2_plugin_imdsv2_success(mock_do_request): r_c = getattr(ec2_plugin, 'runtime_context') assert r_c['instance_id'] == 'i-07a181803de94c666' assert r_c['availability_zone'] == 'us-east-2a' - assert r_c['instance_type'] == 't3.xlarge' + assert r_c['instance_type'] == 't3.xlarge_FAIL_THIS' assert r_c['ami_id'] == 'ami-03cca83dd001d4666' From a43946dd2fbd449a3901a1e75dc4ce2906a0f8c4 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava <50466688+srprash@users.noreply.github.com> Date: Mon, 30 Nov 2020 19:28:29 -0800 Subject: [PATCH 06/18] Reverting the test change. Test failed successfully --- tests/test_plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_plugins.py b/tests/test_plugins.py index de44e63d..032bde72 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -29,7 +29,7 @@ def test_ec2_plugin_imdsv2_success(mock_do_request): r_c = getattr(ec2_plugin, 'runtime_context') assert r_c['instance_id'] == 'i-07a181803de94c666' assert r_c['availability_zone'] == 'us-east-2a' - assert r_c['instance_type'] == 't3.xlarge_FAIL_THIS' + assert r_c['instance_type'] == 't3.xlarge' assert r_c['ami_id'] == 'ami-03cca83dd001d4666' From e10e36c9eae4f26930648d555a172ab7087cd204 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava <50466688+srprash@users.noreply.github.com> Date: Mon, 30 Nov 2020 19:30:38 -0800 Subject: [PATCH 07/18] Running gh workflow on push and PR --- .github/workflows/UnitTesting.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting.yaml b/.github/workflows/UnitTesting.yaml index ba3eb03e..f9ed744a 100644 --- a/.github/workflows/UnitTesting.yaml +++ b/.github/workflows/UnitTesting.yaml @@ -1,5 +1,11 @@ name: Unit Testing -on: [push] +on: + push: + branches: + - gh_actions_unit_tests + pull_request: + branches: + - gh_actions_unit_tests jobs: build: From f35104efbc62d170239690dadf16455fe552bf06 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Tue, 1 Dec 2020 23:23:58 -0800 Subject: [PATCH 08/18] Trying a new approach --- .github/workflows/UnitTesting_1.yaml | 26 ++++++++++++++++++++++++++ tox.ini | 8 -------- 2 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/UnitTesting_1.yaml diff --git a/.github/workflows/UnitTesting_1.yaml b/.github/workflows/UnitTesting_1.yaml new file mode 100644 index 00000000..96a5130d --- /dev/null +++ b/.github/workflows/UnitTesting_1.yaml @@ -0,0 +1,26 @@ +name: Unit Testing trial using plain simple gh action +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run tests with Tox + run: tox -e py \ No newline at end of file diff --git a/tox.ini b/tox.ini index 90892984..50f9405f 100644 --- a/tox.ini +++ b/tox.ini @@ -7,14 +7,6 @@ envlist = py{36,37,38}-django31 coverage-report -[gh-actions] -python = - 2.7: py27 - 3.5: py35 - 3.6: py36 - 3.7: py37 - 3.8: py38 - skip_missing_interpreters = True [testenv] From 7e6fc86ccc0049e8c41588c878a264fbbc4b7ec8 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Tue, 1 Dec 2020 23:35:42 -0800 Subject: [PATCH 09/18] Tryin with just tox command --- .github/workflows/UnitTesting_1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting_1.yaml b/.github/workflows/UnitTesting_1.yaml index 96a5130d..d221d22a 100644 --- a/.github/workflows/UnitTesting_1.yaml +++ b/.github/workflows/UnitTesting_1.yaml @@ -23,4 +23,4 @@ jobs: pip install tox - name: Run tests with Tox - run: tox -e py \ No newline at end of file + run: tox \ No newline at end of file From abd71d2c12d7148026cb224b1e7c051935af6efd Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Tue, 1 Dec 2020 23:54:58 -0800 Subject: [PATCH 10/18] Printing python version --- .github/workflows/UnitTesting_1.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting_1.yaml b/.github/workflows/UnitTesting_1.yaml index d221d22a..d4ade5d8 100644 --- a/.github/workflows/UnitTesting_1.yaml +++ b/.github/workflows/UnitTesting_1.yaml @@ -17,10 +17,13 @@ jobs: with: python-version: ${{ matrix.python }} + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install tox - name: Run tests with Tox - run: tox \ No newline at end of file + run: tox -e py \ No newline at end of file From da7d8762814e2df7bbcf2a865694162592b1056a Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Tue, 1 Dec 2020 23:57:16 -0800 Subject: [PATCH 11/18] Printing PATH --- .github/workflows/UnitTesting_1.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/UnitTesting_1.yaml b/.github/workflows/UnitTesting_1.yaml index d4ade5d8..98181f39 100644 --- a/.github/workflows/UnitTesting_1.yaml +++ b/.github/workflows/UnitTesting_1.yaml @@ -20,6 +20,9 @@ jobs: - name: Display Python version run: python -c "import sys; print(sys.version)" + - name: Display PATH + run: echo $PATH + - name: Install dependencies run: | python -m pip install --upgrade pip From 2c58e58c67ac4771eca89999470233738537e419 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Wed, 2 Dec 2020 00:13:07 -0800 Subject: [PATCH 12/18] trying with specific py env --- .github/workflows/UnitTesting_1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting_1.yaml b/.github/workflows/UnitTesting_1.yaml index 98181f39..1b9183bd 100644 --- a/.github/workflows/UnitTesting_1.yaml +++ b/.github/workflows/UnitTesting_1.yaml @@ -29,4 +29,4 @@ jobs: pip install tox - name: Run tests with Tox - run: tox -e py \ No newline at end of file + run: tox -e py37-default \ No newline at end of file From d0480953bef1241f34567faebf38004c81e4ab66 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Thu, 10 Dec 2020 20:24:00 -0800 Subject: [PATCH 13/18] Removing the other test workflow file --- .github/workflows/UnitTesting_1.yaml | 32 ---------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/workflows/UnitTesting_1.yaml diff --git a/.github/workflows/UnitTesting_1.yaml b/.github/workflows/UnitTesting_1.yaml deleted file mode 100644 index 1b9183bd..00000000 --- a/.github/workflows/UnitTesting_1.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Unit Testing trial using plain simple gh action -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] - - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - - name: Display PATH - run: echo $PATH - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox - - - name: Run tests with Tox - run: tox -e py37-default \ No newline at end of file From a538d4c212740bc5f667c5dfe3476d4660950a76 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Thu, 10 Dec 2020 20:26:57 -0800 Subject: [PATCH 14/18] Testing workflow --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4fa33d71..d1f2e353 100644 --- a/README.md +++ b/README.md @@ -476,3 +476,4 @@ db = XRayFlaskSqlAlchemy(app) ## License The AWS X-Ray SDK for Python is licensed under the Apache 2.0 License. See LICENSE and NOTICE.txt for more information. + From a148328c918e437313bd89fe4ab99315af53634a Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Thu, 10 Dec 2020 20:38:28 -0800 Subject: [PATCH 15/18] Adding back the gh_action block to tox.ini --- tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tox.ini b/tox.ini index 50f9405f..4478e3bb 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,14 @@ envlist = py{36,37,38}-django31 coverage-report +[gh-actions] +python = + 2.7: py27 + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + skip_missing_interpreters = True [testenv] From d2dfbf97c3b8e3216b19beb8fb3ffb1dc747e793 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Thu, 10 Dec 2020 20:47:53 -0800 Subject: [PATCH 16/18] Changing target branch to master --- .github/workflows/UnitTesting.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTesting.yaml b/.github/workflows/UnitTesting.yaml index f9ed744a..294f8f62 100644 --- a/.github/workflows/UnitTesting.yaml +++ b/.github/workflows/UnitTesting.yaml @@ -2,10 +2,10 @@ name: Unit Testing on: push: branches: - - gh_actions_unit_tests + - master pull_request: branches: - - gh_actions_unit_tests + - master jobs: build: From 8e86250cc63ea5405e4bee6c02ecbcb86b91b8dd Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Thu, 10 Dec 2020 20:54:17 -0800 Subject: [PATCH 17/18] Removing travis.yml --- .travis.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 74c53b66..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: python -dist: xenial -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -install: - - pip install tox tox-travis - -notifications: - email: - recipients: - - aws-xray-peryton@amazon.com - on_success: never - on_failure: always - -script: - - tox From 98867dfd9f9815123e4d2a825bb04edee81a68c3 Mon Sep 17 00:00:00 2001 From: Prashant Srivastava Date: Thu, 10 Dec 2020 21:01:12 -0800 Subject: [PATCH 18/18] Removing travis from tox --- README.md | 1 - tox.ini | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d1f2e353..4fa33d71 100644 --- a/README.md +++ b/README.md @@ -476,4 +476,3 @@ db = XRayFlaskSqlAlchemy(app) ## License The AWS X-Ray SDK for Python is licensed under the Apache 2.0 License. See LICENSE and NOTICE.txt for more information. - diff --git a/tox.ini b/tox.ini index 4478e3bb..db6b9d9c 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ python = skip_missing_interpreters = True [testenv] -passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_* GITHUB_* +passenv = TOXENV CI CODECOV_* GITHUB_* deps = pytest > 3.0.0 coverage==4.5.4