Skip to content
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

Enable YAML conformance tests #549

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

Zaid-Ajaj
Copy link
Contributor

This PR is initial work for enable YAML conformance tests, implements GeneratePackage, GenerateProgram and Pack in the language plugin. Correctly propagates RootDirectory as the directory where the YAML templates should be loaded from.

Implementing local dependencies was a bit tricky, I went the route of adding support for it in program-gen where a package dependency that version {version} becomes a default provider resource in the YAML program itself:

resources:
  default-simple-provider:
    type: pulumi:providers:simple
    defaultProvider: true
    options:
      version: 1.0.0
  res:
    type: simple:Resource
    properties:
      value: true

This however fails today in YAML runtime because it tries to load the simple package from an existing binary or tries to download it but that doesn't work because in conformance tests these local packages have an in-memory implementation.

YAML runtime does its own plugin loading to type-check the template which blocks conformance tests. We need to be able to load schemas from the engine and simply connect to a schema loader service from YAML runtime

@Frassle
Copy link
Member

Frassle commented Feb 2, 2024

Implementing local dependencies was a bit tricky,

So there's plugin querying which unquestionably needs to return the right thing, and dependency querying which is useful if it returns the right thing but for yaml it doesn't really have dependencies.

So maybe we make conformance testing allow a language plugin to return NotImplemented for GetProgramDependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants