Skip to content

Commit

Permalink
Merge pull request #10706 from felliott/feature/remove-travis
Browse files Browse the repository at this point in the history
[ENG-5753] remove mentions of TravisCI from repo
  • Loading branch information
felliott authored Aug 16, 2024
2 parents c468eaa + b5ba66c commit 7f2dc54
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 217 deletions.
6 changes: 3 additions & 3 deletions .github/actions/start-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ runs:
- name: Copy Settings
shell: bash
run: |
cp website/settings/local-travis.py website/settings/local.py
cp api/base/settings/local-travis.py api/base/settings/local.py
cp website/settings/local-ci.py website/settings/local.py
cp api/base/settings/local-ci.py api/base/settings/local.py
mkdir -p ~/preprints
touch ~/preprints/index.html
- name: PIP install
Expand All @@ -41,7 +41,7 @@ runs:
shell: bash
run: |
# bumped psycopg to match requirements.txt, as otherwise build would fail
poetry run python3 -m invoke travis-addon-settings
poetry run python3 -m invoke ci-addon-settings
pip uninstall uritemplate.py --yes
# use yarn add --exact to match versions in yarn.lock w/o installing all deps
yarn add --exact bower@^1.8.8
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-travis-addons -n 1 --junit
run: poetry run python3 -m invoke test-ci-addons -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
Expand All @@ -79,7 +79,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-travis-website -n 1 --junit
run: poetry run python3 -m invoke test-ci-website -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: NVM & yarn install
run: poetry run python3 -m invoke assets --dev
- name: Run test
run: poetry run python3 -m invoke test-travis-api1-and-js -n 1 --junit
run: poetry run python3 -m invoke test-ci-api1-and-js -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
Expand All @@ -135,7 +135,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-travis-api2 -n 1 --junit
run: poetry run python3 -m invoke test-ci-api2 -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-travis-api3-and-osf -n 1 --junit
run: poetry run python3 -m invoke test-ci-api3-and-osf -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
185 changes: 0 additions & 185 deletions .travis.yml

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion api/base/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
MAX_SIZE_OF_ES_QUERY = 10000
DEFAULT_ES_NULL_VALUE = 'N/A'

TRAVIS_ENV = False
CI_ENV = False

CITATION_STYLES_REPO_URL = 'https://github.com/CenterForOpenScience/styles/archive/88e6ed31a91e9f5a480b486029cda97b535935d4.zip'
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

ALLOWED_HOSTS.append('localhost')

TRAVIS_ENV = True
CI_ENV = True
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def test_filter(self, app, url, admin, populate_counts):
resp = app.get(f'{url}?filter[department]=Psychology dept', auth=admin.auth)
assert resp.json['data'][0]['attributes']['department'] == 'Psychology dept'

@pytest.mark.skipif(settings.TRAVIS_ENV, reason='Non-deterministic fails on travis')
@pytest.mark.skipif(settings.CI_ENV, reason='Non-deterministic fails on CI')
def test_sort_and_pagination(self, app, url, user, user2, user3, admin, populate_counts, populate_more_counts, institution):
resp = app.get(f'{url}?sort=user_name&page[size]=1&page=2', auth=admin.auth)
assert resp.status_code == 200
Expand All @@ -229,7 +229,7 @@ def test_sort_and_pagination(self, app, url, user, user2, user3, admin, populate
assert resp.json['links']['meta']['total'] == 11
assert resp.json['data'][-1]['attributes']['user_name'] == 'Zedd'

@pytest.mark.skipif(settings.TRAVIS_ENV, reason='Non-deterministic fails on travis')
@pytest.mark.skipif(settings.CI_ENV, reason='Non-deterministic fails on CI')
def test_filter_and_pagination(self, app, user, user2, user3, url, admin, populate_counts, populate_more_counts, institution):
resp = app.get(f'{url}?page=2', auth=admin.auth)
assert resp.json['links']['meta']['total'] == 11
Expand All @@ -238,7 +238,7 @@ def test_filter_and_pagination(self, app, user, user2, user3, url, admin, popula
assert resp.json['links']['meta']['total'] == 1
assert resp.json['data'][0]['attributes']['user_name'] == 'Zedd'

@pytest.mark.skipif(settings.TRAVIS_ENV, reason='Non-deterministic fails on travis')
@pytest.mark.skipif(settings.CI_ENV, reason='Non-deterministic fails on CI')
def test_filter_and_sort(self, app, url, user, user2, user3, admin, user4, populate_counts, populate_na_department, institution):
"""
Testing for bug where sorting and filtering would throw 502.
Expand Down
2 changes: 1 addition & 1 deletion api_tests/metrics/test_preprint_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_preprint_list_with_metrics_fails(self, mock_timezone, app, user, base_u
res = app.get(one_preprint_url, auth=other_non_admin_user.auth, expect_errors=True)
assert res.status_code == 403

@pytest.mark.skip('Return results will be entirely mocked so does not make a lot of sense to run on travis.')
@pytest.mark.skip('Return results will be entirely mocked so does not make a lot of sense to run on ci.')
@mock.patch('api.metrics.utils.timezone.now')
def test_preprint_with_metrics_succeeds(self, mock_timezone, app, user, base_url, preprint, other_user,
preprint_no_results, metric_dates):
Expand Down
2 changes: 1 addition & 1 deletion osf_tests/management_commands/test_reindex_es6.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def url(self):
return f'{settings.API_DOMAIN}_/metrics/preprints/downloads/'

@pytest.mark.es
@pytest.mark.skipif(django_settings.TRAVIS_ENV, reason='Non-deterministic fails on travis')
@pytest.mark.skipif(django_settings.CI_ENV, reason='Non-deterministic fails on CI')
def test_reindexing(self, app, url, preprint, user, admin, es6_client):
preprint_download = PreprintDownload.record_for_preprint(
preprint,
Expand Down
34 changes: 17 additions & 17 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,47 +470,47 @@ def remove_failures_from_testmon(ctx, db_path=None):

conn = sqlite3.connect(db_path)
tests_decached = conn.execute("delete from node where result <> '{}'").rowcount
ctx.run(f'echo {tests_decached} failures purged from travis cache')
ctx.run(f'echo {tests_decached} failures purged from ci cache')

@task
def travis_setup(ctx):
def ci_setup(ctx):
with open('package.json') as fobj:
package_json = json.load(fobj)
ctx.run('npm install @centerforopenscience/list-of-licenses@{}'.format(package_json['dependencies']['@centerforopenscience/list-of-licenses']), echo=True)

@task
def test_travis_addons(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
def test_ci_addons(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
"""
Run half of the tests to help travis go faster.
Run half of the tests to help ci go faster.
"""
#travis_setup(ctx)
#ci_setup(ctx)
syntax(ctx)
test_addons(ctx, numprocesses=numprocesses, coverage=coverage, testmon=testmon, junit=junit)

@task
def test_travis_website(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
def test_ci_website(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
"""
Run other half of the tests to help travis go faster.
Run other half of the tests to help ci go faster.
"""
#travis_setup(ctx)
#ci_setup(ctx)
test_website(ctx, numprocesses=numprocesses, coverage=coverage, testmon=testmon, junit=junit)


@task
def test_travis_api1_and_js(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
#travis_setup(ctx)
def test_ci_api1_and_js(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
#ci_setup(ctx)
test_api1(ctx, numprocesses=numprocesses, coverage=coverage, testmon=testmon, junit=junit)


@task
def test_travis_api2(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
#travis_setup(ctx)
def test_ci_api2(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
#ci_setup(ctx)
test_api2(ctx, numprocesses=numprocesses, coverage=coverage, testmon=testmon, junit=junit)


@task
def test_travis_api3_and_osf(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
#travis_setup(ctx)
def test_ci_api3_and_osf(ctx, numprocesses=None, coverage=False, testmon=False, junit=False):
#ci_setup(ctx)
test_api3(ctx, numprocesses=numprocesses, coverage=coverage, testmon=testmon, junit=junit)

@task
Expand Down Expand Up @@ -559,13 +559,13 @@ def addon_requirements(ctx):


@task
def travis_addon_settings(ctx):
def ci_addon_settings(ctx):
for directory in os.listdir(settings.ADDON_PATH):
path = os.path.join(settings.ADDON_PATH, directory, 'settings')
if os.path.isdir(path):
try:
open(os.path.join(path, 'local-travis.py'))
ctx.run('cp {path}/local-travis.py {path}/local.py'.format(path=path))
open(os.path.join(path, 'local-ci.py'))
ctx.run('cp {path}/local-ci.py {path}/local.py'.format(path=path))
except OSError:
pass

Expand Down
File renamed without changes.

0 comments on commit 7f2dc54

Please sign in to comment.