-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature: Testsuite #42
Conversation
b49c32d
to
49278cb
Compare
This changeset adds a substantive and useful testsuite, with tests split based on coverage support and backend/frontend disposition. Coverage support is included in this changeset (at least for tests in languages that support it, which, for now, is Java). Changes so far: - [x] Refactor and cleanup testsuite - [x] Move most app targets to samples - [x] Get unified coverage working for Java - [x] Change web tests to use Karma - [x] Begin measuring coverage via Karma - [ ] Unified coverage support for all languages - [x] Java: basic junit testing - [ ] JS: Via Karma/Istanbul - [ ] Python: unclear so far
49278cb
to
1da364c
Compare
- Report Java coverage (properly tagged) to Codecov - Run coverage reporter in CI - Small tweaks to VERBOSE and QUIET in Makefile
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=========================================
Coverage ? 99.68%
=========================================
Files ? 33
Lines ? 957
Branches ? 0
=========================================
Hits ? 954
Misses ? 3
Partials ? 0
Continue to review full report at Codecov.
|
- Ability to execute backend JS tests - No support for coverage yet - Support for test reporting via ReportCI
- Merge test results via custom Python script - Report via ReportCI
* Sample App: Todolist This changeset adds a new sample app, which ties together all the features thus far and adds some new ones to facilitate easy app development. I'm using this sample to help define the underlying framework structure, when used with Micronaut/Soy. The sample is built with unified modelling via Protobuf, and RPC dispatch via gRPC. The UI is built with Soy, with SSR support via Soy/Java, and re-hydrated CSR support via Soy/JS (and `idom`). The app's data backend is powered by Firestore, with objects mediated for serialization by the framework. This process is also driven by the protos. Auth is also powered by Firebase, which enables easy data permissions. Via the central API definition, the app can automatically generate an API console, docs, and Open API/Swagger configs. It is also dispatchable from nearly any platform (via either gRPC or REST). Endpoints served in this manner support either Protobuf on the wire, or JSON (when using REST). Styles are defined in SASS but processed by both GSS and PostCSS, which enables both (1) tight optimization on a per-browser basis, and (2) style modularity when serving. The server can also rewrite styles using a Soy/GSS rewrite map. The sample additionally demonstrates testing, with coverage (where supported by the framework, so far). * Add simple tests for Soy renaming maps * Cleanup cloudbuild targets * Switch tests off in GCB * Cleanup and testing for existing core.backend logic * Fix definitions for JS interop * Early `PageContext` logic and example - Gather proto and other page context into `SoyContextMediator` - Override Micronaut Views/Views Soy deps (see micronaut-projects/micronaut-views#34) - Update Soy lib and jssrc deps - Fix CSP error specified by default in `application.yml` - Serve HTML from controller * Refactor Java dependencies and rules - Add better exclusions for Google coordinates - Add source dependencies for Protobuf and gRPC - Upgrade/conform dependency tree to Protobuf/gRPC latest * Seal Java dependencies * Further gRPC support in Todolist - Add support for reflection service - Make service / interceptor simple passthroughs * New todolist port arrangement - Run app on :8081 - Run API on :8082 * Add Todolist sample to cloudbuild config * Eliminate remote build in GCB * Adjust build stamp to fallback to COMMIT_SHA variable * Apply fix for image tag in GCB * Add K8S rules dependency * Further adjustments to GCB config * Fix misplaced deploy jar target * Pull and tag latest todolist image on build * Add initial ambassador config * Remove failing build artifact upload in GCB * Add initial test for PageContext * Improvements to page context integration - Add extended `SoyProtoContextMediator` interface - Add efficient empty context use - Cover `PageContext` with tests * Adjust coverage reporting * Refactor `HomeController` to use new `AppController` - Add `PageContextManager` and factory - Init `AppController` and `BaseController` - Adjust Bazel flags to be normalized * Cleanup and simplify PageContext/PageContextManager - Remove embedded PageContextManager.Factory - Clean up DI flow - Fix issue injecting HTTP request * Initial Todolist infrastructure configs - Add full suite of K8S configs, scoped to `todolist` namespace - Add customized Envoy configuration and image * Toolchain support for Docker, Kubernetes and packaging - Add macros for generic Docker images - Add macros for Kubernetes configs - Add macros for packaging * Pull in Envoy base image, setup K9 defaults * Add rules_pkg dependency * Add yarn run alias for gRPC CLI * Converge bazelrc and WORKSPACE for Todolist * Major work on Envoy proxy * Use manually-built Envoy image, for now * Fix spacing issue in bazelrc * Add external LB for testing * Use fully-qualified service DNS * Setup devops flow for Envoy and Todolist (including deploy) - Add deploy routine to GCB (CI will likely fail) - Enable reflection service (+add logging) - Tweaks to Envoy config, including healthcheck logging * Fixes for ingress configuration * Transition to independent NEGs * [skip ci] Change to Bazel 2.1.0 in GCB * Prep version bump -> 1.0.0-alpha2 * Fix incorrect Bazel version in GCB * Fix prefix for Bazel images in GCB (late steps) * Pin and build K8S toolchain from source * Attempt fix for K8S transitive load * Upgrade K8S > 1.15.9 * Update K8S hash, add dep on infrastructure tools * Switchup alias for K8S repo infra * Apply incompatible trip flags to fix K8S in GCB * Alias K8S repo * Clean up K8S tools reference * Add custom builder image for deploy, use it * Switch up GCB image for 2nd-to-last build step * Upgrade GCB image -> v1b * Shift build steps to GCB image * Add Alpine version of builder image * Prep CI image for use * Back to Ubuntu builder, install OpenJDK * Add git to GCB environment * Auto-remove packages in builder image * Upgrade to builder v1d * Add unzip to build image :eyeroll: * Version bump for build image -> v1e * Add regular Python package to GCB * Version bump for GCB -> v1f * Upgrade GCB image -> v1g (add symlink to gcloud) * Fix Python rules in CI * Add todolist internal gateway * Fix pip issues in CI * Remove external LB for Todolist * Always use latest GCB builder * Cleanup Python deps, add pypandoc to build env * Support for ibazel-based development flow - Call ibazel from Makefile when `m dev` is used - Tweak flags and invocation to work - Flush out issue with Soy render context * Update Micronaut/Soy packages with context fix * Fix access to ADC * Add ibazel_live_reload to Java app targets * Support Java-side live reload * Re-enable test reporting, add Travis env vars * Stop upgrading deps in CI image * Add Makefile task to build builder image * Major README and licensing cleanup/improvements * Refactor app boot logic * Cleanup after refactor, fix various issues reported by Codacy * Cleanup startup exception flow * Add GraphQL to readme * Root folder cleanup * Add new badges to README * Tweaks to README * Remove .develop aliases * Adjust coverage config to be lenient until it settles * Remove Makefile aliases * Fix Makefile command list in README * Small nits * Fix spaces-in-tags in Soy templates * Add interface to set page title * Remove old page root * Install logback as the underlying log implementation * Add sugar for page context, title, assets - Add ability to change page title, inject stylesheets/scripts - Add ability to easily generate trusted URI protos - Rename SoyProtoContextMediator > PageRender - Make PageContextManager usable as a PageRender - Use new fluent interface in HomeController * 🚀 Fix Soy render with injected context - Working injected context. Yay! - Logback is working too - Cleaned up page context manager with improved log messages * Fix render bugs on homepage * Remove empty table in README * Feature: Model Layer (#65) * Feature: Model Adapters This changeset introduces backend logic to deal with business data (i.e. *schema-driven models*). As part of this work, I'm also building out underlying stuff needed for that, including managed transport, generic model adapters/codecs, and so on. Related issues: - App Framework (#27) - MVP Functionality Matrix (#43) In this PR: - [x] **Backend logic: Models** - [x] Interfaces for persistence managers, drivers, codecs - [x] Serializer and deserializer interfaces - [x] Cache-related manager interfaces - [x] Container for encoded models - [x] Codec for encoding models in proto formats - [x] Encoded (generic) model - [x] Serialization to `CollapsedModel`/`OutputStream`/`bytes` - [x] Deserialization from `InputStream`/`bytes` - [x] Interface support for simple CRUD operations - [x] `retrieve`: Fetch a structured record from storage. - [x] `persist`: Write a structured record to storage. - [x] `delete`: Erase a structured record from storage. - [x] Cache driver support for basic operations - [x] `put`: Write a model to a cache - [x] `fetch`: Retrieve a model from the cache - [x] `evict`: Evict one or more cached models, by key - [x] `flush`: Drop all keys from the cache - [x] **Backend logic: Transport** - [x] Simple `TransportManager` interface - [x] Managed gRPC channels for Google APIs - [x] `GoogleTransportManager`: channel management - [x] Ability to refresh channels? - [x] Service support list - [x] Firestore - [x] **Backend logic: Built-in Drivers** - [x] In-memory Adapter (reference) - [x] Initial `InmemoryManager` implementation - [x] Initial `InmemoryDriver` implementation - [x] Initial `InmemoryCache` implementation - [x] Test suite - [x] Simple model interactions - [x] Update/create methods - [x] Delete methods - [x] Cache operations
There are too many results to compare The test coverage on the diff in this pull request is 99.6% (50% is the threshold). This pull request will bring the total coverage in the repository to 99.6%. View more on Code Climate. |
This changeset adds a substantive and useful testsuite, with tests split based on coverage support and backend/frontend disposition. Coverage support is included in this changeset (at least for tests in languages that support it, which, for now, is Java).
Changes so far:
Frontend: Via Karma/Istanbul(#9)Backend: Via Node/C8/Jasmine(#8)Python: unclear so far(#8)