kilo-org/kilo-marketplace

lookml-tests

>- Standards and best practices for writing LookML tests to ensure data integrity, accuracy, and logic validation.

First seen Jun 28, 2026

Installation

$ npx skills add kilo-org/kilo-marketplace --skill lookml-tests

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from kilo-org/kilo-marketplace · top by installs.

npx skills add kilo-org/kilo-marketplace

Browse all from kilo-org/kilo-marketplace

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 173
License LICENSE
Default branch main
Open issues 14
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
category
data
source
{"repository":"https:\/\/github.com\/looker-open-source\/looker-skills","path":"skills\/lookml-tests","license_path":"LICENSE","commit":"c530d1b7efee1db49851a04563ce946adfd191a8"}

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,162 B
  • docs SUMMARY.md 131 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 7 installs

SKILL.md

LookML Testing Standards

Testing is critical for maintaining trust in data. LookML tests allow us to verify that our semantic model behaves as expected and that the underlying data conforms to our assumptions.

1. File Organization

  • Location: Define tests in tests/[explore_name].test.lkml.
  • One Suite Per Explore: Each file should contain all the test definitions for a specific Explore.
  • Naming Convention: [explore_name].test.lkml (e.g., orders.test.lkml).

2. Test Structure

Each test consists of an explore_source query and an assert statement.

test: [test_name] {
  explore_source: [explore_name] {
    column: [column_name] { field: [view_name].[field_name] }
    filters: {
      field: [view_name].[field_name]
      value: "[value]"
    }
  }

  assert: [assertion_name] {
    expression: ${[view_name].[field_name]} [operator] [value] ;;
  }
}

3. Types of Tests

A. Integrity Checks (Critical)

Verify that Primary Keys remain unique after joins. This is the best defense against "fanout" errors caused by incorrect onetomany join definitions.

Example: Primary Key Uniqueness

test: orders_pk_is_unique {
  explore_source: orders {
    column: order_id {}
    column: count {}
    # Limit to recent data to save costs/time if table is large
    filters: {
      field: orders.created_date
      value: "last 7 days"
    }
  }

  assert: order_id_is_unique {
    expression: ${orders.count} = 1 ;;
  }
}

B. Accuracy Tests

Validate specific measure values against known constants or expectations.

Example: Revenue is Positive

test: revenue_is_positive {
  explore_source: orders {
    column: total_revenue {}
    filters: {
      field: orders.created_date
      value: "yesterday"
    }
  }

  assert: revenue_greater_than_zero {
    expression: ${orders.total_revenue} >= 0 ;;
  }
}

C. Business Logic Validation

Ensure calculations behave as expected. For example, checking that grossmargin is never greater than revenue or that lifetimeorders is never NULL for an active user.

Example: Logic Check

test: margin_less_than_revenue {
  explore_source: orders {
    column: total_revenue {}
    column: total_margin {}
  }

  assert: margin_is_valid {
    expression: ${orders.total_margin} <= ${orders.total_revenue} ;;
  }
}

4. Best Practices

  • Descriptive Extensions: Use informative names for tests (orderspkisunique) and assertions (orderidisunique).
  • Performance: Use filters (e.g., last 7 days) to limit the scan size for large tables, unless verifying full history is required.
  • Model Inclusion: Ensure test files are included in the model file (e.g., include: "/tests/*.test.lkml").