Avi Kondareddy | ea02942 | 2018-11-16 18:33:00 -0800 | [diff] [blame] | 1 | load( |
| 2 | "@io_bazel_rules_docker//container:container.bzl", |
| 3 | "container_image", |
| 4 | "container_push", |
| 5 | ) |
Maria Ignacio | bfd4182 | 2019-08-07 14:28:01 -0700 | [diff] [blame] | 6 | load("@rules_pkg//:pkg.bzl", "pkg_tar") |
Avi Kondareddy | ea02942 | 2018-11-16 18:33:00 -0800 | [diff] [blame] | 7 | load("@debs//file:packages.bzl", "packages") |
| 8 | load("//:debs.bzl", "get_dep_list") |
| 9 | |
Maria Ignacio | bfd4182 | 2019-08-07 14:28:01 -0700 | [diff] [blame] | 10 | pkg_tar( |
| 11 | name = "lcov_configs", |
| 12 | package_dir = "/lcov", |
| 13 | srcs = [ |
| 14 | "lcov/lcov.css", |
| 15 | "lcov/emerald.png", |
| 16 | "lcov/ruby.png", |
| 17 | ], |
| 18 | ) |
| 19 | |
Avi Kondareddy | ea02942 | 2018-11-16 18:33:00 -0800 | [diff] [blame] | 20 | # build container using kunit.sh and latest kunitconfig from gerrit |
| 21 | container_image( |
| 22 | name = "kunit", |
| 23 | base = "@debian_base//image", |
| 24 | debs = [packages[x] for x in get_dep_list()], |
| 25 | directory = "/", |
| 26 | entrypoint = "/kunit.sh", |
| 27 | files = [ |
| 28 | "kunit.sh", |
| 29 | "@kunitconfig_repo//:kunitconfig", |
| 30 | ], |
Maria Ignacio | bfd4182 | 2019-08-07 14:28:01 -0700 | [diff] [blame] | 31 | tars = ["lcov_configs"], |
Avi Kondareddy | ea02942 | 2018-11-16 18:33:00 -0800 | [diff] [blame] | 32 | mode = "777", |
| 33 | repository = "kunit-presubmit/kunit", |
| 34 | ) |
| 35 | |
| 36 | container_push( |
| 37 | name = "push_kunit", |
| 38 | format = "Docker", |
| 39 | image = ":kunit", |
| 40 | registry = "gcr.io", |
| 41 | repository = "kunit-presubmit/kunit", |
| 42 | tag = "latest", |
| 43 | ) |
| 44 | |
| 45 | # build test container using latest kunit source |
| 46 | container_image( |
| 47 | name = "kunit_test", |
| 48 | base = ":kunit", |
| 49 | directory = "/kunit/linux", |
| 50 | env = {"ARTIFACTS": "kunit/artifacts"}, |
| 51 | repository = "kunit-presubmit/test", |
| 52 | tars = ["@kunit_repo//:files"], |
| 53 | workdir = "/kunit/linux", |
| 54 | ) |
Darya Verzhbinsky | 9fe6c35 | 2019-08-08 16:14:27 -0700 | [diff] [blame] | 55 | |
| 56 | py_library( |
| 57 | name = "lcov_parser", |
| 58 | srcs = ["lcov_parser/lcov_parser.py"], |
| 59 | ) |
| 60 | |
| 61 | py_test( |
| 62 | name = "lcov_parser_test", |
David Gow | 99576e9 | 2019-08-30 15:52:12 -0700 | [diff] [blame] | 63 | srcs = ["lcov_parser/lcov_parser_test.py"], |
Darya Verzhbinsky | 9fe6c35 | 2019-08-08 16:14:27 -0700 | [diff] [blame] | 64 | python_version = "PY3", |
| 65 | deps = ["lcov_parser/lcov_parser.py"], |
| 66 | ) |