Skip to content

Commit

Permalink
Merge pull request #5 from oppia/develop
Browse files Browse the repository at this point in the history
Merge changes from oppia
  • Loading branch information
dchen97 committed Dec 20, 2019
2 parents 7f5e682 + 17b6e0f commit da8e482
Show file tree
Hide file tree
Showing 3,586 changed files with 496,613 additions and 170,160 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
147 changes: 147 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
workflows:
version: 2
circleci_tests:
jobs:
- setup
- lint_tests:
requires:
- setup
- typescript_tests:
requires:
- setup
- frontend_tests:
requires:
- setup
- backend_tests:
requires:
- setup

var_for_docker_image: &docker_image circleci/python:2.7.14-jessie-browsers

anchor_for_job_defaults: &job_defaults
working_directory: /home/circleci/oppia
# Its okay to hardcode the CC_TEST_REPORTER_ID as the only risk in doing so is
# when someone uses this test coverage ID to post incorrect coverage data.
# This generally does not occur and if it happens, it would be replaced with
# data from subsequent coverage payloads. See this comment for more
# information: https://github.com/oppia/oppia/pull/7067#issuecomment-508822501
environment:
CC_TEST_REPORTER_ID: 561968e2f03d3bb4f1aed69dc94174c2e3b9dc82cf1f8ad31fc799f8c67afc6e
docker:
- image: *docker_image

anchor_for_installing_dependencies: &install_dependencies
name: Install dependencies
command: |
python -m scripts.install_third_party_libs
anchor_for_installing_cc_test_reporter: &install_cc
name: Install codeclimate test reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
anchor_for_restoring_cache: &restore_cache
keys:
- setup-files-cache-{{ checksum "date" }}
- third-party-cache-{{ checksum "date" }}

version: 2
jobs:
setup:
<<: *job_defaults
steps:
- checkout
- run: date +%F > date
- restore_cache:
<<: *restore_cache
- run:
<<: *install_dependencies
- save_cache:
key: setup-files-cache-{{ checksum "date" }}
paths:
- node_modules/
- ../oppia_tools/

lint_tests:
<<: *job_defaults
steps:
- checkout
- run:
<<: *install_dependencies
- run:
name: Run lint tests
# All the python scripts should behave as modules. Files like the
# pre_commit_linter and third_party_size_check need to import other
# Python files and that is only possible if we treat it as a module.
command: |
python -m scripts.third_party_size_check
python -m scripts.pre_commit_linter --path=. --verbose
typescript_tests:
<<: *job_defaults
steps:
- checkout
- run:
<<: *install_dependencies
- run: date +%F > date
- restore_cache:
<<: *restore_cache
- run:
name: Run typescript tests
command: |
python -m scripts.typescript_checks
frontend_tests:
<<: *job_defaults
steps:
- checkout
- run:
<<: *install_dependencies
- run: date +%F > date
- restore_cache:
<<: *restore_cache
- run:
name: Run frontend tests
command: |
python -m scripts.run_frontend_tests --run_minified_tests --skip_install
- run:
name: Generate frontend coverage report
command: |
sudo pip install codecov
codecov --file ../karma_coverage_reports/lcov.info -F frontend
when: on_success

backend_tests:
<<: *job_defaults
steps:
- checkout
- run:
<<: *install_dependencies
- run: date +%F > date
- restore_cache:
<<: *restore_cache
- run: sudo pip install webtest
- run: sudo pip install coverage
- run:
name: Run backend tests
command: |
python -m scripts.run_backend_tests --generate_coverage_report --exclude_load_tests
- run:
<<: *install_cc
- run:
name: Generate backend coverage report
command: |
sudo pip install codecov
codecov -F backend
./cc-test-reporter format-coverage -t coverage.py coverage.xml
./cc-test-reporter sum-coverage coverage/codeclimate.json
./cc-test-reporter upload-coverage
when: on_success

notify:
webhooks:
# A list of hook hashes, containing the url field
# gitter hook
- url: https://webhooks.gitter.im/e/71ac71505d1d45161035
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# .coveragerc to control coverage.py
[run]
omit =
*/oppia_tools/*
*/third_party/*
*/usr/*
*_test.py
*core/tests/*
*__init__.py
# TODO(#7419): Remove python_utils from the list once the codebase is
# run under Python 3.
python_utils.py
7 changes: 4 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
core/templates/dev/head/expressions/ExpressionParserService.js
core/templates/dev/head/expressions/expression-parser.service.js
core/templates/dev/head/google-analytics.initializer.ts
backend_prod_files/*
core/tests/protractor.conf.js
extensions/interactions/LogicProof/static/js/generatedDefaultData.js
extensions/interactions/LogicProof/static/js/generatedParser.js
extensions/interactions/LogicProof/static/js/generatedDefaultData.ts
extensions/interactions/LogicProof/static/js/generatedParser.ts
integrations/*
integrations_dev/*
assets/scripts/*
Expand Down
52 changes: 45 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"eslint:recommended"
],
"plugins": [
"angular",
"html"
"html",
"@typescript-eslint"
],
"overrides": [{
// We exclude test files from dependency injection format checks because
// they are never minified.
"files": ["*Spec.js", "*Spec.ts"],
"rules": {
"angular/di": "off"
}
}],
"rules": {
"angular/di": [
"error",
"array",
],
"angular/di-order": "error",
],
"angular/di-unused": "error",
"angular/directive-restrict": [
"error",
Expand Down Expand Up @@ -64,6 +76,18 @@
"error",
"always"
],
"no-restricted-globals": [
"error", "addEventListener", "blur", "close", "closed", "confirm",
"defaultStatus", "event", "external", "defaultstatus", "find", "focus",
"frameElement", "frames", "history", "innerHeight", "innerWidth",
"length", "location", "locationbar", "menubar", "moveBy", "moveTo",
"name", "onblur", "onerror", "onfocus", "onload", "onresize", "onunload",
"open", "opener", "opera", "outerHeight", "outerWidth", "pageXOffset",
"pageYOffset", "parent", "print", "removeEventListener", "resizeBy",
"resizeTo", "screen", "screenLeft", "screenTop", "screenX", "screenY",
"scroll", "scrollbars", "scrollBy", "scrollTo", "scrollX", "scrollY",
"self", "sessionStorage", "status", "statusbar", "stop",
"toolbar", "top"],
"func-style": [
"error",
"expression"
Expand Down Expand Up @@ -95,8 +119,10 @@
],
"max-len": [
"error",
"code": 80,
"ignoreUrls": true
{
"code": 80,
"ignoreUrls": true
}
],
"no-compare-neg": "off",
"no-console": [
Expand All @@ -123,6 +149,7 @@
"no-multi-str": [
"error"
],
"no-prototype-builtins": "off",
"no-redeclare": [
"off"
],
Expand Down Expand Up @@ -163,7 +190,10 @@
"keywords": true
}
],
"semi": [
// The following must be off so that we can enable
// "@typescript-eslint/semi", which checks semicolons in TS files.
"semi": "off",
"space-before-blocks": [
"error",
"always"
],
Expand All @@ -189,6 +219,14 @@
"nonwords": false,
}
],
"switch-colon-spacing": [
"error",
{
"after": true,
"before": false
}
],
"@typescript-eslint/semi": ["error"],
"wrap-iife": [
"error",
"any"
Expand Down
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ AUTHORS text eol=lf
CHANGELOG text eol=lf
CONTRIBUTORS text eol=lf
LICENSE text eol=lf
Vagrantfile text eol=lf


# Binary files
# ============
Expand Down

0 comments on commit da8e482

Please sign in to comment.