Some javascript testing patterns that has made writing tests at Refinery29 more maintainable. Covered in this presentation is userContext (or let) in Jasmine, lazy evaluation and shared behavior.
This document provides an introduction to unit testing JavaScript code with Jasmine and Karma. It discusses the basics of Jasmine including test suites, specs, expectations, and matchers. It then covers how to set up and run tests with Karma, including configuring Karma, running tests in browsers, handling failures, and testing AngularJS code. Specific topics covered include spies, $httpBackend for mocking HTTP requests, and testing controllers and dependencies injection.
Ember has an amazing testing story built upon the fundamentals of encapsulation and OO programming central to the framework. Despite this, every web application will be dependent upon and need to interact with native and network APIs that are hostile: Unreliable, slow, under-documented, and not to be trusted. The challenge in testing Ember applications lies with how to handle these external entities.
For a number of years now we have been hearing about all of the benefits that automated unit testing provides like increasing our quality, catching errors earlier, ensuring that all developers are testing in the same manner and deploying updates with high confidence that nothing will break. Testing a Web UI though was difficult and fragile which meant that typically we had no automated unit test for our Web UI. This is no longer the case with the latest release of Angular. Unit testing is now a first class citizen in Angular.
Out of the box, the project generated by the Angular CLI has unit testing setup with Karma and Jasmine and includes sample tests. Generating new components, services, and pipes includes the unit test Spec file already wired up. Thus allowing you to focus on writing your unit tests and not on the infrastructure needed to get them running. The barriers to writing unit test have been destroyed.
This talk will walk through getting started unit testing your Angular components, services, and pipes. Along the way I will share the tips and tricks that I have learned as I have implemented unit testing on my Angular projects at a Fortune 100 company. You will walk away ready to immediately implement unit testing on your Angular project.
Good karma: UX Patterns and Unit Testing in Angular with Karma
The document discusses unit testing in Angular with Karma. It provides examples of UX patterns in Angular like binding elements to variables, lists, and click handlers. It also covers what controllers and scopes are and examples of testing components in Angular like services, factories, and UI elements. Hands-on examples are provided for setting up a test environment and writing tests.
Unit testing frameworks like Jasmine and Mocha can be used to write unit tests in Angular. Jasmine requires less setup and is fully BDD compliant. Tests are organized into describe blocks for test suites and it blocks for individual specs. Expectations are made using the expect function and matcher functions. Spies can mock and spy on functions. Karma is a test runner that runs tests across browsers and re-runs on file changes. It is configured via a karma.conf.js file. Unit tests validate controllers, services, and other application code. End-to-end tests using Protractor validate full user workflows and interactions.
A high-level introduction to testing in EmberJS. This talk explains the difference between unit, integration and acceptance tests, when to use each and how to get started with ember-cli-mocha.
Unit testing Angular applications is important to ensure components and services work as expected. There are several frameworks that can be used for Angular unit testing, including Jasmine for writing tests and Karma as a test runner. Key aspects of unit testing covered in the document include: using test doubles like stubs and spies to isolate the system under test; focusing tests on small units and targeting specific assertions; and dealing with asynchronous code. The document also provides examples of writing pure unit tests in Jasmine without dependencies and using spies to control dependencies.
A presentation made for the AngularJS-IL meetup group that took place in May 2014 at Google TLV Campus. its a demonstration of Unit testing an AngularJS component with jasmine and karma.
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
This document discusses JavaScript test-driven development using Jasmine 2.0 and Karma. It introduces test-driven development principles and benefits, then covers the Karma test runner, PhantomJS browser, and features of the Jasmine testing framework including describe blocks, expectations, matchers, spies, and custom matchers. It also provides an example of mapping earthquakes and testing color-coded circles using magnitude and discusses code coverage and sustaining test-driven practices.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
This document provides an overview of the Spring framework. Key points include:
- Spring is a lightweight container that promotes loose coupling and separation of concerns through dependency injection.
- It simplifies programming without J2EE by providing declarative transaction management and abstraction from underlying technologies.
- Spring uses dependency injection and inversion of control to configure and wire together components. It supports setter, constructor, and autowiring of dependencies.
- The Spring container manages the lifecycle of beans through initialization and destruction callbacks.
This document discusses client-side testing using Jasmine and Karma. It introduces Jasmine as the most popular testing framework for writing unit tests in the browser. It demonstrates a simple example of using Jasmine to test a Person constructor function. It then discusses Karma, a test runner that makes browser testing seamless. Karma allows running tests across multiple browsers simultaneously. The document also covers techniques for testing AngularJS controllers and services, including mocking external server calls. It emphasizes that while tests may pass using mocks, the mocks represent the contract with the external code being tested.
Testing most things in JavaScript - LeedsJS 31/05/2017
Testing is important - it can improve the quality of your code and give you the reassurance to refactor without fear of destroying your application.
My talk will cover different types of automated testing in javascript (unit, integration, acceptance) and some regression as well tools to help standardise code (like js lint).
I'll also talk about automated build tools like jenkins and travis ci.
Testing with Jasmine provides a framework for writing and running unit tests in JavaScript. It uses a behavior-driven development (BDD) style in which each test specifies the expected behavior it is testing using a describe and it blocks. Within the it block, expect statements make assertions about the code being tested using matchers like toEqual. Jasmine provides spies for mocking function calls and stubs. Running tests involves including Jasmine library files and specs in an HTML page and executing them with a simple HTTP server. Jasmine can also be used to test views by creating DOM fixtures and making assertions about the rendered markup.
MyApp provides JavaScript best practices including:
1) Using namespaces to avoid naming collisions and define packages like MyApp.string.utils for reusable functions.
2) Branching code during initialization or lazily on first use to handle browser differences efficiently.
3) Passing configuration as an object instead of many parameters to simplify function calls.
4) Defining private methods and properties using closures to encapsulate code.
5) Employing self-executing functions for one-time initialization tasks.
6) Allowing method chaining for readability when calling several related methods.
Quick tour to front end unit testing using jasmine
This document discusses front-end unit testing using the Jasmine testing framework. It explains why unit testing is important, introduces behavior-driven development and the Jasmine framework. It also provides an overview of setting up Jasmine, creating test suites and specs, using matchers, and testing asynchronous code. The document demonstrates how to set up the testing environment, write tests with Jasmine, and integrate Jasmine with the Karma test runner.
Protractor is an open source functional testing framework for AngularJS applications. It automates interaction with AngularJS apps for end-to-end testing. Protractor uses Selenium WebDriver for browser control and Jasmine or Mocha for writing test cases. Tests are organized into pages, common utilities, test data, specs, and configuration files. Protractor provides locators and functions to test AngularJS apps and generates Allure reports for test results.
AngularJS Unit Testing w/Karma and Jasminefoxp2code
This document provides instructions for setting up Angular unit testing with Karma and Jasmine. It discusses initializing Karma and Jasmine via NPM, configuring Karma, adding Angular and Angular mocks via Bower, writing describe and it blocks for tests, and using matchers and mocks like $httpBackend. The live coding section at the end indicates the document will demonstrate these concepts in real tests.
This document discusses RSpec, a testing framework for Ruby. It begins by explaining what RSpec is and its Given-When-Then structure. It then provides details on setting up and using RSpec with Ruby, Rails, controllers, models, and features tests using Capybara. Tips are given on FactoryGirl, fixtures, Guard, and configuring .rspec. Matchers, cheatsheets, and resources for learning more are also referenced.
This document provides an introduction to unit testing JavaScript code with Jasmine and Karma. It discusses the basics of Jasmine including test suites, specs, expectations, and matchers. It then covers how to set up and run tests with Karma, including configuring Karma, running tests in browsers, handling failures, and testing AngularJS code. Specific topics covered include spies, $httpBackend for mocking HTTP requests, and testing controllers and dependencies injection.
Testing Ember Apps: Managing DependencyMatthew Beale
Ember has an amazing testing story built upon the fundamentals of encapsulation and OO programming central to the framework. Despite this, every web application will be dependent upon and need to interact with native and network APIs that are hostile: Unreliable, slow, under-documented, and not to be trusted. The challenge in testing Ember applications lies with how to handle these external entities.
For a number of years now we have been hearing about all of the benefits that automated unit testing provides like increasing our quality, catching errors earlier, ensuring that all developers are testing in the same manner and deploying updates with high confidence that nothing will break. Testing a Web UI though was difficult and fragile which meant that typically we had no automated unit test for our Web UI. This is no longer the case with the latest release of Angular. Unit testing is now a first class citizen in Angular.
Out of the box, the project generated by the Angular CLI has unit testing setup with Karma and Jasmine and includes sample tests. Generating new components, services, and pipes includes the unit test Spec file already wired up. Thus allowing you to focus on writing your unit tests and not on the infrastructure needed to get them running. The barriers to writing unit test have been destroyed.
This talk will walk through getting started unit testing your Angular components, services, and pipes. Along the way I will share the tips and tricks that I have learned as I have implemented unit testing on my Angular projects at a Fortune 100 company. You will walk away ready to immediately implement unit testing on your Angular project.
Good karma: UX Patterns and Unit Testing in Angular with KarmaExoLeaders.com
The document discusses unit testing in Angular with Karma. It provides examples of UX patterns in Angular like binding elements to variables, lists, and click handlers. It also covers what controllers and scopes are and examples of testing components in Angular like services, factories, and UI elements. Hands-on examples are provided for setting up a test environment and writing tests.
Unit testing frameworks like Jasmine and Mocha can be used to write unit tests in Angular. Jasmine requires less setup and is fully BDD compliant. Tests are organized into describe blocks for test suites and it blocks for individual specs. Expectations are made using the expect function and matcher functions. Spies can mock and spy on functions. Karma is a test runner that runs tests across browsers and re-runs on file changes. It is configured via a karma.conf.js file. Unit tests validate controllers, services, and other application code. End-to-end tests using Protractor validate full user workflows and interactions.
A high-level introduction to testing in EmberJS. This talk explains the difference between unit, integration and acceptance tests, when to use each and how to get started with ember-cli-mocha.
Unit testing Angular applications is important to ensure components and services work as expected. There are several frameworks that can be used for Angular unit testing, including Jasmine for writing tests and Karma as a test runner. Key aspects of unit testing covered in the document include: using test doubles like stubs and spies to isolate the system under test; focusing tests on small units and targeting specific assertions; and dealing with asynchronous code. The document also provides examples of writing pure unit tests in Jasmine without dependencies and using spies to control dependencies.
A presentation made for the AngularJS-IL meetup group that took place in May 2014 at Google TLV Campus. its a demonstration of Unit testing an AngularJS component with jasmine and karma.
JavaScript Test-Driven Development with Jasmine 2.0 and Karma Christopher Bartling
This document discusses JavaScript test-driven development using Jasmine 2.0 and Karma. It introduces test-driven development principles and benefits, then covers the Karma test runner, PhantomJS browser, and features of the Jasmine testing framework including describe blocks, expectations, matchers, spies, and custom matchers. It also provides an example of mapping earthquakes and testing color-coded circles using magnitude and discusses code coverage and sustaining test-driven practices.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
This document provides an overview of the Spring framework. Key points include:
- Spring is a lightweight container that promotes loose coupling and separation of concerns through dependency injection.
- It simplifies programming without J2EE by providing declarative transaction management and abstraction from underlying technologies.
- Spring uses dependency injection and inversion of control to configure and wire together components. It supports setter, constructor, and autowiring of dependencies.
- The Spring container manages the lifecycle of beans through initialization and destruction callbacks.
Client side unit tests - using jasmine & karmaAdam Klein
This document discusses client-side testing using Jasmine and Karma. It introduces Jasmine as the most popular testing framework for writing unit tests in the browser. It demonstrates a simple example of using Jasmine to test a Person constructor function. It then discusses Karma, a test runner that makes browser testing seamless. Karma allows running tests across multiple browsers simultaneously. The document also covers techniques for testing AngularJS controllers and services, including mocking external server calls. It emphasizes that while tests may pass using mocks, the mocks represent the contract with the external code being tested.
Testing most things in JavaScript - LeedsJS 31/05/2017Colin Oakley
Testing is important - it can improve the quality of your code and give you the reassurance to refactor without fear of destroying your application.
My talk will cover different types of automated testing in javascript (unit, integration, acceptance) and some regression as well tools to help standardise code (like js lint).
I'll also talk about automated build tools like jenkins and travis ci.
Intro to testing Javascript with jasmineTimothy Oxley
Testing with Jasmine provides a framework for writing and running unit tests in JavaScript. It uses a behavior-driven development (BDD) style in which each test specifies the expected behavior it is testing using a describe and it blocks. Within the it block, expect statements make assertions about the code being tested using matchers like toEqual. Jasmine provides spies for mocking function calls and stubs. Running tests involves including Jasmine library files and specs in an HTML page and executing them with a simple HTTP server. Jasmine can also be used to test views by creating DOM fixtures and making assertions about the rendered markup.
MyApp provides JavaScript best practices including:
1) Using namespaces to avoid naming collisions and define packages like MyApp.string.utils for reusable functions.
2) Branching code during initialization or lazily on first use to handle browser differences efficiently.
3) Passing configuration as an object instead of many parameters to simplify function calls.
4) Defining private methods and properties using closures to encapsulate code.
5) Employing self-executing functions for one-time initialization tasks.
6) Allowing method chaining for readability when calling several related methods.
Quick tour to front end unit testing using jasmineGil Fink
This document discusses front-end unit testing using the Jasmine testing framework. It explains why unit testing is important, introduces behavior-driven development and the Jasmine framework. It also provides an overview of setting up Jasmine, creating test suites and specs, using matchers, and testing asynchronous code. The document demonstrates how to set up the testing environment, write tests with Jasmine, and integrate Jasmine with the Karma test runner.
Protractor framework architecture with exampleshadabgilani
Protractor is an open source functional testing framework for AngularJS applications. It automates interaction with AngularJS apps for end-to-end testing. Protractor uses Selenium WebDriver for browser control and Jasmine or Mocha for writing test cases. Tests are organized into pages, common utilities, test data, specs, and configuration files. Protractor provides locators and functions to test AngularJS apps and generates Allure reports for test results.
The document provides guidelines for testing Rails applications. It recommends that any code change should be driven by a failed test. Tests should be close to the code being tested and focus on functionality rather than specific code. It discusses testing models, associations, named scopes, validations, controllers, views, helpers, emails, user interactions, Ajax requests, external sites, Rake tasks, file uploads, legacy applications, and more. The goal is to have tests that result in high-quality code through a test-first approach.
The document discusses tools and techniques for making Java development more enjoyable. It recommends using libraries like Mockito, Guice and Guava to simplify testing and dependency injection. It also suggests using builder patterns, writing concise yet descriptive unit tests, and avoiding string-typing in favor of object-oriented types.
This document discusses AngularJS application architecture best practices including:
- Separation of concerns by component type and feature
- Consistent syntax such as aliasing 'this' for nested functions
- Organizing the app by feature rather than type for larger apps
- Naming conventions for controllers, services, directives
- Using modules to aggregate dependencies
- Best practices for controllers, AJAX calls, unit testing, and end-to-end testing
Leverage patterns of large-scale JS – such as modules, publish-subscribe and delegation – to achieve extreme performance without sacrificing maintainability.
The document discusses several tools for JavaScript development including:
1. ECMAScript 6 for new JavaScript features, Visual Studio Code for editing, and Node.js & npm for modules.
2. Build tools like webpack, Babel, and UglifyJS to bundle, transpile, and minimize code.
3. Testing with Jasmine and debugging with Chrome Developer Tools and source maps.
4. Documentation generation with YUIDoc.
A demo project is provided at https://github.com/simonkim/jstools-demo to show how to use these tools together in a workflow.
The document provides an overview of Node.js and the Express web framework. It discusses that Node.js is a platform for executing JavaScript files and includes utilities for network and file I/O. Express is a web application framework built on Node.js that uses middleware to handle requests. The document covers Express concepts like routing, middleware, templating, and popular middleware modules for tasks like compression, parsing request bodies, and sessions.
This document provides a history of JavaScript and ECMAScript specifications from 1995 to the present. It discusses the standardization process and key people and organizations involved like B. Eich, TC39, and ECMA. Major versions and proposed features are summarized, including ES6/ES2015 additions like arrow functions, block scoping with let/const, classes, modules, iterators/generators, and proxies.
The document discusses FuseJS, a JavaScript framework that aims to improve performance and compatibility across browsers. It includes sandboxed native objects to prevent namespace pollution, modular builds, and various selector engines. It also details optimizations for quirks mode, events, caching, and performance benchmarks showing FuseJS has lower execution times than other frameworks.
Presented at Bucharest Java User Group, http://www.bjug.ro/editii/5.html . Project source code available at: https://github.com/bucharest-jug/dropwizard-todo
The document describes the Xopus JavaScript application framework. The framework aims to address problems with structuring JavaScript programs by introducing object-oriented paradigms like modules, classes, and dependencies. It allows writing JavaScript code in an extended subset with OO features, compiles it to flattened code, and supports unit testing and other program analysis tools. The framework provides a consistent way to structure programs into packages and make dependencies explicit without runtime overhead.
Javascript unit testing, yes we can e bigAndy Peterson
This document discusses test-driven development for JavaScript using ScrewUnit and BlueRidge. It introduces the Carbon Five consulting firm and covers why JavaScript unit testing is important. It then demonstrates how to write behavioral tests using ScrewUnit's BDD style and shows a live example testing a wizard component. Some challenges of JavaScript testing like DOM cleanup and structure are addressed. The document emphasizes that JavaScript testing is possible and can be integrated into the development process.
The document provides an introduction to JUnit testing in Java. It discusses how to set up a JUnit test with the AEM testing framework using the AemContextExtension. Key aspects covered include adding Sling models to the test context, loading mock JSON resources, and adapting requests to test Sling models. The anatomy of a JUnit test is explained with examples of setting up mocks, verifying expectations, and asserting results. Mocking and the Mockito framework are also introduced for simulating dependencies in tests.
Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data.
The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs.
Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution!
Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Chris Swan
Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge.
You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter.
The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.
Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.
Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 :
- Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants.
- REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.
An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)
The Rise of Supernetwork Data Intensive ComputingLarry Smarr
Invited Remote Lecture to SC21
The International Conference for High Performance Computing, Networking, Storage, and Analysis
St. Louis, Missouri
November 18, 2021
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
Choose our Linux Web Hosting for a seamless and successful online presencerajancomputerfbd
Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently.
Visit- https://onliveserver.com/linux-web-hosting/
UiPath Community Day Kraków: Devs4Devs ConferenceUiPathCommunity
We are honored to launch and host this event for our UiPath Polish Community, with the help of our partners - Proservartner!
We certainly hope we have managed to spike your interest in the subjects to be presented and the incredible networking opportunities at hand, too!
Check out our proposed agenda below 👇👇
08:30 ☕ Welcome coffee (30')
09:00 Opening note/ Intro to UiPath Community (10')
Cristina Vidu, Global Manager, Marketing Community @UiPath
Dawid Kot, Digital Transformation Lead @Proservartner
09:10 Cloud migration - Proservartner & DOVISTA case study (30')
Marcin Drozdowski, Automation CoE Manager @DOVISTA
Pawel Kamiński, RPA developer @DOVISTA
Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner
09:40 From bottlenecks to breakthroughs: Citizen Development in action (25')
Pawel Poplawski, Director, Improvement and Automation @McCormick & Company
Michał Cieślak, Senior Manager, Automation Programs @McCormick & Company
10:05 Next-level bots: API integration in UiPath Studio (30')
Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner
10:35 ☕ Coffee Break (15')
10:50 Document Understanding with my RPA Companion (45')
Ewa Gruszka, Enterprise Sales Specialist, AI & ML @UiPath
11:35 Power up your Robots: GenAI and GPT in REFramework (45')
Krzysztof Karaszewski, Global RPA Product Manager
12:20 🍕 Lunch Break (1hr)
13:20 From Concept to Quality: UiPath Test Suite for AI-powered Knowledge Bots (30')
Kamil Miśko, UiPath MVP, Senior RPA Developer @Zurich Insurance
13:50 Communications Mining - focus on AI capabilities (30')
Thomasz Wierzbicki, Business Analyst @Office Samurai
14:20 Polish MVP panel: Insights on MVP award achievements and career profiling
Measuring the Impact of Network Latency at TwitterScyllaDB
Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfNeo4j
Presented at Gartner Data & Analytics, London Maty 2024. BT Group has used the Neo4j Graph Database to enable impressive digital transformation programs over the last 6 years. By re-imagining their operational support systems to adopt self-serve and data lead principles they have substantially reduced the number of applications and complexity of their operations. The result has been a substantial reduction in risk and costs while improving time to value, innovation, and process automation. Join this session to hear their story, the lessons they learned along the way and how their future innovation plans include the exploration of uses of EKG + Generative AI.
Best Practices for Effectively Running dbt in Airflow.pdfTatiana Al-Chueyr
As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models.
This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through:
- Standard ways of running dbt (and when to utilize other methods)
- How Cosmos can be used to run and visualize your dbt projects in Airflow
- Common challenges and how to address them, including performance, dependency conflicts, and more
- How running dbt projects in Airflow helps with cost optimization
Webinar given on 9 July 2024
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
7. Introduction
Team Bicycle
● A Director of Product and Two developers
● Behavior Driven Development and Pairing
● Launched the new mobile web experience in 5 months
● 1000 Unit Tests and 200 Acceptance Tests
10. Introduction
Team Bicycle
● A Director of Product and Two developers
● Behavior Driven Development and Pairing
● Launched the new mobile web experience in 5 months
● 1000 Unit Tests and 200 Acceptance Tests
A team built for speed.
12. Structure Grunt sets up tasks for running tests, example: grunt specs:debug
Gruntfile.js # Grunt for automating test runs
karma.conf.js # Karma for unit testing (Chrome for debugging, PhantomJS for CI builds in
Jenkins)
app/
| js/
| | models/
| | **/*.js
| | views/
| | **/*.js
spec/
| js/
| | models/
| | **/*_spec.js
| | views/
| | **/*_spec.js
13. Structure Karma sets up our testing environments. Great for running tests on actual devices.
Gruntfile.js # Grunt for automating test runs
karma.conf.js # Karma for unit testing (Chrome for debugging, PhantomJS for CI builds in
Jenkins)
app/
| js/
| | models/
| | **/*.js
| | views/
| | **/*.js
spec/
| js/
| | models/
| | **/*_spec.js
| | views/
| | **/*_spec.js
14. Structure The spec/ directory mirrors app/
Gruntfile.js # Grunt for automating test runs
karma.conf.js # Karma for unit testing
app/
| js/
| | models/
| | **/*.js
| | views/
| | **/*.js
spec/
| js/
| | models/
| | **/*_spec.js
| | views/
| | **/*_spec.js
15. Structure Inside of spec/ is the helpers/ directory for global setup/tear down,
mocks, convenience functions and custom Jasmine matchers.
Gruntfile.js # Grunt for automating test runs
karma.conf.js # Karma for unit testing
app/
| js/
| | models/
| | **/*.js
| | views/
| | **/*.js
spec/
| helpers/
| | *.js # Helper files loaded in Karma
| js/
| | models/
| | **/*_spec.js
| | views/
| | **/*_spec.js
16. Structure Our rspec acceptance tests also live in spec/
Gruntfile.js # Grunt for automating test runs
karma.conf.js # Karma for unit testing
app/
| js/
| | models/
| | **/*.js
| | views/
| | **/*.js
spec/
| helpers/
| | *.js # Helper files loaded in Karma
| js/
| | models/
| | **/*_spec.js
| | views/
| | **/*_spec.js
| features/
| | *_spec.rb
| | spec_helper.rb
| | support/
| | **/*.rb
17. Patterns
DRY it up
describe('views.card', function() {
var model, view;
beforeEach(function() {
model = {};
view = new CardView(model);
});
describe('.render', function() {
beforeEach(function() {
model.title = 'An Article';
view.render();
});
it('creates a "cardTitle" h3 tag set to the model's title', function() {
expect(view.$el.find('.cardTitle')).toContainText(model.title);
});
});
describe('when the model card type is "author_card"', function() {
beforeEach(function() {
model.type = 'author_card';
view.render();
});
it('adds an "authorCard" class to it's $el', function() {
expect(view.$el).toHaveClass('authorCard');
});
});
});
18. Patterns
Using this
describe('views.card', function() {
beforeEach(function() {
this.model = {};
this.view = new CardView(this.model);
});
describe('.render', function() {
beforeEach(function() {
this.model.title = 'An Article';
this.view.render();
});
it('creates a "cardTitle" h3 tag set to the model's title', function() {
expect(this.view.$el.find('.cardTitle')).toContainText(this.model.title);
});
});
describe('when the model card type is "author_card"', function() {
beforeEach(function() {
this.model.type = 'author_card';
this.view.render();
});
it('adds an "authorCard" class to it's $el', function() {
expect(this.view.$el).toHaveClass('authorCard');
});
});
});
19. Patterns
Using this
Jasmine’s userContext (aka this)
● Shared between before/afterEach hooks and tests
(including nested tests)
● Cleaned up after every test
● Removes the need for keeping track of variable declarations
● Removes problems that may occur due to scoping and/or hoisting issues
● No global leaks
● Clearer meaning within tests
● Leads the way to...
20. Patterns
Lazy Eval
beforeEach(function() {
this.let_ = function(propName, getter) { // need to use "_" suffix since 'let' is a token in ES6
var _lazy;
Object.defineProperty(this, propName, {
get: function() {
if (!_lazy) {
_lazy = getter.call(this);
}
return _lazy;
},
set: function() {},
enumerable: true,
configurable: true
});
};
});
Lazy Evaluation (a la Rspec’s let)
describe('.render', function() {
beforeEach(function() {
this.let_('renderedView', function() {
return this.view.render();
});
this.model.title = 'An Article';
});
// ...
21. Patterns
Lazy Eval
describe('views.Card', function() {
beforeEach(function() {
this.model = {};
this.view = new CardView(this.model);
});
describe('.render', function() {
beforeEach(function() {
this.model.title = 'An Article';
this.let_('renderedView', function() {
return this.view.render();
});
});
it('creates a "cardTitle" h3 tag set to the model's title', function() {
expect(this.renderedView.$el.find('.cardTitle')).toContainText(this.model.title);
});
describe('when the model card type is "author_card"', function() {
beforeEach(function() {
this.model.type = 'author_card'; // no need to re-render the view here!
});
it('adds an "authorCard" class to its $el', function() {
expect(this.renderedView.$el).toHaveClass('authorCard');
});
// ...
22. Patterns
Lazy Eval
Lazy Evaluation
● Our render spec, now uses let_
● We only have to call render once, in the getter function, even if we change
the model in nested beforeEach blocks
● Reduced code duplication
● Reduced chance of pollution due to side effects
● Smaller file sizes!
● Note: everything here can be used for Mocha as well!
23. Patterns
Behaves Like
describe('Email', function() {
beforeEach(function() {
this.emailAddress = 'some@example.com';
this.let_('email', function() {
return new Email(this.emailAddress);
});
});
describe('.validate', function() {
describe('when emailAddress is missing the "@" symbol', function() {
beforeEach(function() {
this.emailAddress = 'someexample.com';
});
it('returns false', function() {
expect(this.email.validate()).toBe(false);
});
});
describe('when emailAddress is missing a domain after the "@" symbol', function() {
beforeEach(function() {
this.emailAddress = 'some@.org';
});
it('returns false', function() {
expect(this.email.validate()).toBe(false);
});
});
});
});
24. Patterns
Behaves Like
Shared Behavior
● Thorough, but lots of copy-pasta code
● If API changes, all tests have to be updated
○ e.g. what if validate changes to return a string?
● RSpec solves this with “shared examples”
● Need something like that here...
25. Patterns
Behaves Like
describe('Email', function() {
beforeEach(function() {
this.emailAddress = 'some@example.com';
this.let_('email', function() {
return new Email(this.emailAddress);
});
});
describe('.validate', function() {
shouldInvalidate('an email without an "@" sign', 'someexample.org');
shouldInvalidate('missing a domain', 'some@.org');
//..
function shouldInvalidate(desc, example) {
describe('when emailAddress is ' + desc, function() {
beforeEach(function() {
this.emailAddress = example;
});
it('returns false', function() {
expect(this.email.validate()).toBe(false);
});
});
}
});
});
26. Patterns
Behaves Like
Shared Behavior
● No more duplication of testing logic
● Extremely readable
● Leverage this along with javascripts metaprogramming techniques to create
dynamically built suites
● Looks great in the console
● Completely DRY
● Huge win for something like email validation, where there are tons of cases
to test
● Prevents having one test with a large amount of assertions
27. Resources
We’re Hiring
Front-End Engineer | Full Time
QA Engineer | Full Time
Developer Tools & Automation Engineer | Full Time
Junior DevOps Engineer | Full Time
Desktop Support Engineer | Full Time
Back-End Engineer | Full Time