From 98aef57239cb9356927c50ee1c35eddedbe3acd7 Mon Sep 17 00:00:00 2001 From: Chandra Prakash Date: Wed, 16 Aug 2023 07:47:40 -0700 Subject: [PATCH 1/3] Migrate Travis-ci to Github actions --- .github/workflows/fuzz-lightyear-build.yml | 32 ++++++++++++++++++++++ .travis.yml | 14 ---------- tox.ini | 2 +- 3 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/fuzz-lightyear-build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/fuzz-lightyear-build.yml b/.github/workflows/fuzz-lightyear-build.yml new file mode 100644 index 0000000..948a09c --- /dev/null +++ b/.github/workflows/fuzz-lightyear-build.yml @@ -0,0 +1,32 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: fuzz-lightyear-build + +on: + push: + branches: [ "master" ] + pull_request: + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies and test + run: | + python -m pip install --upgrade pip setuptools tox virtualenv + tox diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b329c9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -matrix: - include: - - python: 3.6 - env: TOXENV=py36 - - python: 3.7 - env: TOXENV=py37 - sudo: required # required for Python >= 3.7 (travis-ci/travis-ci#9069) - dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069) - - python: 3.6 - env: TOXENV=pre-commit -install: - - pip install tox -script: make test diff --git a/tox.ini b/tox.ini index f8bec24..8b99d31 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] project = fuzz_lightyear -# These should match the travis env list +# These should match the .github/workflows/fuzz-lightyear-build env list envlist = pre-commit,py38 skip_missing_interpreters = true tox_pip_extensions_ext_venv_update = true From 1f941c007be8714e6fd866f6872231341bf2e113 Mon Sep 17 00:00:00 2001 From: Chandra Prakash Date: Thu, 17 Aug 2023 07:38:09 -0700 Subject: [PATCH 2/3] fix tests and multiprocessing for mac and windows --- .github/workflows/fuzz-lightyear-build.yml | 6 ++++-- requirements-dev-minimal.txt | 1 + requirements-dev.txt | 1 + testing/mock_server.py | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fuzz-lightyear-build.yml b/.github/workflows/fuzz-lightyear-build.yml index 948a09c..9219a96 100644 --- a/.github/workflows/fuzz-lightyear-build.yml +++ b/.github/workflows/fuzz-lightyear-build.yml @@ -18,13 +18,15 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + # tests.result_test.test_successful_sequence is flaky in GA's version of python (3.8.17) + # fixing to current python version of devbox + # also, 3.8.13 is not available for platform==win32; so setting a range + python-version: '>=3.8.10 <=3.8.13' - name: Install dependencies and test run: | diff --git a/requirements-dev-minimal.txt b/requirements-dev-minimal.txt index 67bcc0d..94806a4 100644 --- a/requirements-dev-minimal.txt +++ b/requirements-dev-minimal.txt @@ -2,6 +2,7 @@ coverage flask flask-restplus +multiprocess mypy pre-commit pytest diff --git a/requirements-dev.txt b/requirements-dev.txt index bf03d0b..efb73d1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -27,6 +27,7 @@ MarkupSafe==1.1.1 monotonic==1.5 more-itertools==7.2.0 msgpack-python==0.5.6 +multiprocess==0.70.15 mypy==0.720 mypy-extensions==0.4.1 nodeenv==1.3.3 diff --git a/testing/mock_server.py b/testing/mock_server.py index fb90073..f975f68 100644 --- a/testing/mock_server.py +++ b/testing/mock_server.py @@ -1,12 +1,12 @@ import json import logging -import multiprocessing as mp import os from contextlib import contextmanager from contextlib import redirect_stdout from time import sleep import requests +from multiprocess import Process from testing.vulnerable_app.__main__ import main as start_server @@ -32,7 +32,7 @@ def spin_up_server(): is_it_up = is_server_up() if not is_it_up: starting_up = True - mp.Process( + Process( target=spin_up_server, ).start() From 1800d258842d11bcd082cc146a29e8bc71a72ebf Mon Sep 17 00:00:00 2001 From: Chandra Prakash Date: Thu, 17 Aug 2023 08:40:44 -0700 Subject: [PATCH 3/3] Add build status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acceb94..1c078d1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.com/Yelp/fuzz-lightyear.svg?branch=master)](https://travis-ci.com/Yelp/fuzz-lightyear) +[![Build Status](https://github.com/Yelp/fuzz-lightyear/actions/workflows/fuzz-lightyear-build.yml/badge.svg)](https://github.com/Yelp/fuzz-lightyear/actions/workflows/fuzz-lightyear-build.yml) # fuzz-lightyear