Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split test jobs in Travis #3613

Merged
merged 19 commits into from
May 14, 2018
Merged

Split test jobs in Travis #3613

merged 19 commits into from
May 14, 2018

Conversation

chetanmeh
Copy link
Member

@chetanmeh chetanmeh commented May 4, 2018

Splits the Travis build to have 2 separate jobs for running tests

Description

This PR splits the travis setup in 2 parts

  1. Test requiring only database
  2. Test requiring complete OpenWhisk system

See discussions in #3572 for details

Implementation Details

This PR introduces a notion of testSets which define set of filters for which test to execute. It defines 3 sets for now

  1. REQUIRE_ONLY_DB - Test which just need database to be up
  2. REQUIRE_SYSTEM - Test which require whole OpenWhisk runtime up. Excludes tests under 1
  3. LEAN - Include all lean test i.e. current master

Changes in checkLogs.py

checkLogs.py currently performs some log sanity check like checking if db, controller logs are non empty. With this PR for REQUIRE_ONLY_DB controller logs would not be there. So it has been modified to support tags. Each check specify set of tags to which it belongs like db and system. And then checkLogs.py would specify the tags which it wants to enforce checks for

TODO

  • - Optimize jobs to remove steps not required. For e.g. avoid deploying containers for pure db tests

Related issue and scope

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

@chetanmeh
Copy link
Member Author

chetanmeh commented May 4, 2018

image

Did few runs on my fork and have following observation

  1. Having multiple jobs seems to slow down task compared to when there were only 2 jobs. For e.g. the wrk-performance jobs used to take ~14-15 mins earlier and now it took 20 mins
  2. For now PR did minimal change. As next step we can see if breaking down build into sub parts and skipping parts which are not required depending on test reduces time or not

As Apache has a pool of 30 instances would see how much time it takes as part of PR build which uses same pool

@codecov-io
Copy link

codecov-io commented May 4, 2018

Codecov Report

Merging #3613 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3613      +/-   ##
==========================================
- Coverage   74.57%   74.49%   -0.09%     
==========================================
  Files         126      126              
  Lines        5982     5990       +8     
  Branches      397      390       -7     
==========================================
+ Hits         4461     4462       +1     
- Misses       1521     1528       +7
Impacted Files Coverage Δ
...isk/core/database/memory/MemoryArtifactStore.scala 78.78% <0%> (-5.09%) ⬇️
...rc/main/scala/whisk/common/ForcableSemaphore.scala 88.46% <0%> (+3.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2194c85...f569cb8. Read the comment docs.

@chetanmeh
Copy link
Member Author

image

Current build timings for this PR. Build time reduces from ~44 mins to ~35 mins. Next would try splitting and optimizing the build steps

@chetanmeh
Copy link
Member Author

chetanmeh commented May 8, 2018

Post splitting of build.sh time has come down to ~ 31 mins (current master is at 46 mins)

image

Build Scan

So total 1242 tests. Current master has 1247 tests. So looking into what is missing

.travis.yml Outdated
- ansible-playbook -i ansible/environments/local ansible/logs.yml # collect logs regardless of build exit
- ./tools/travis/box-upload.py "$TRAVIS_BUILD_DIR/logs" "$TRAVIS_BUILD_ID-$TRAVIS_BRANCH.tar.gz"
env: DESCRIPTION="Execute test suite."
- tools/build/checkLogs.py logs db
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not consistent ./tools starting with ./

@csantanapr
Copy link
Member

This looks awesome @chetanmeh good progress.
And took overall build time down to ~30 minutes

^^ @rabbah

Copy link
Member

@csantanapr csantanapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no task, or documented how to run all tests.

//The value can be specified either via env variable
// ORG_GRADLE_PROJECT_testSetName
//Or via property -PtestSetName
if (!project.hasProperty("testSetName")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need to offer a way to run all tests.
In our downstream we run ./gradlew tests:test to run all tests.

I tried this and it doesn't run all tests, only LEAN

🔥  $ ./gradlew tests:test

> Configure project :tests
Using testSet LEAN - {
    "excludes": [
        "**/*Swift*",
        "**/*Python*",
        "**/*Java*",
        "**/*ThrottleTests*",
        "**/MaxActionDurationTests*",
        "**/*ApiGwRestBasicTests*",
        "**/*WskCli*",
        "**/*Swift*",
        "**/*Python*",
        "**/*Java*",
        "**/*ThrottleTests*",
        "**/MaxActionDurationTests*",
        "**/*ApiGwRestBasicTests*",
        "**/*WskCli*"
    ]
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a misleading log which was getting logged due to build task evaluation triggering print message to be logged. Despite this log all tests would have been run.

This has been fixed now

@chetanmeh
Copy link
Member Author

Added a new task to just run unit tests which do not require even a running CouchDB server locally.

$ ansible-playbook -i ansible/environments/local ansible/properties.yml
$ ./gradlew tests:testUnit

This task runs 823 tests in 2.5 mins!. So developers can run a large portion of test suite locally and can test changes locally for early feedback and faster development

@csantanapr
Copy link
Member

I tested this internally and .gradlew tests:test still runs all tests

@csantanapr csantanapr merged commit fb5f853 into apache:master May 14, 2018
@chetanmeh chetanmeh mentioned this pull request Jun 4, 2018
21 tasks
@chetanmeh chetanmeh deleted the travis-split branch November 6, 2018 12:01
BillZong pushed a commit to BillZong/openwhisk that referenced this pull request Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants