Skip to content

kopexa-grc/krn-fixtures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

KRN Test Fixtures

Part of the Kopexa GRC Platform

Shared test fixtures for Kopexa Resource Names (KRN) packages across different languages.

Purpose

This repository contains language-agnostic test cases that ensure compatibility between:

Usage

As a Git Submodule

# Add to your project
git submodule add https://github.com/kopexa-grc/krn-fixtures.git fixtures

# Update to latest
git submodule update --remote fixtures

File Structure

testcases.json    # All test cases
schema.json       # JSON Schema for validation

Test Categories

Parse Tests

  • valid: KRN strings that should parse successfully with expected properties
  • invalid: KRN strings that should fail with specific error codes

Round Trip Tests

KRN strings where parse(input).toString() === input must hold true.

Validation Tests

Test cases for validation functions:

  • isValidResourceId
  • isValidVersion
  • isValidService

Safe Resource ID Tests

Test cases for the safeResourceId sanitization function.

Operation Tests

Test cases for KRN operations:

  • parent() - Get parent KRN
  • withVersion() / withoutVersion()
  • withService() / withoutService()
  • child() - Create child KRN
  • resourceId() - Get resource ID by collection

Error Codes

All implementations must support these error codes:

Code Description
EMPTY_KRN Empty input string
INVALID_KRN Malformed KRN structure
INVALID_DOMAIN Wrong domain or invalid service name
INVALID_RESOURCE_ID Invalid resource ID format
INVALID_VERSION Invalid version format
RESOURCE_NOT_FOUND Collection not found in KRN

Contributing

  1. Update testcases.json with new test cases
  2. Ensure schema validation passes
  3. Update all language implementations to pass new tests
  4. Submit PR

Related Packages

About Kopexa

Kopexa is a modern GRC (Governance, Risk, and Compliance) platform that helps organizations manage their compliance requirements efficiently.

License

Copyright (c) Kopexa GRC

Licensed under the Apache License, Version 2.0.

About

Shared test fixtures for KRN packages - ensuring cross-language compatibility

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors