Skip to content

Conversation

@OutlawAndy
Copy link
Member

@OutlawAndy OutlawAndy commented Sep 21, 2025

Why?

There is a lot of boilerplate required to setup generator specs.

What Changed

What changed in this PR?

  • remove much of the boilerplate required for most generator specs.
  • Add replace_content Generator helper
  • Improve JasminePlaywrightGenerator (issues explained below)
  • capture stdout when running additional generators in flash & navbar specs. (specs that run other generators like this, still need to set their destination manually)

Pre-merge checklist

  • Update relevant READMEs
  • Update version number in lib/rolemodel_rails/version.rb

JasminePlaywrightGenerator issues:

  • Rails.root does not work in this context (use source_root or destination_root)
  • should raise an error if the generator cannot complete successfully
  • .node-version already exists in the example apps. That was causing specs to lock up waiting for user to handle the file conflict. In this case, it's safe to force a replacement.
  • Yarn cannot find the package @rolemodel/jasmine-playwright-runner without a valid github package token.

@OutlawAndy OutlawAndy force-pushed the consistant-test-setup branch from ce2e1b0 to adf9f21 Compare September 21, 2025 22:16
@OutlawAndy OutlawAndy requested a review from wesrich September 21, 2025 22:19
@OutlawAndy OutlawAndy self-assigned this Sep 21, 2025
Copy link
Contributor

@wesrich wesrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is fine, other than the internal node package being dropped. Once that comment is solved, it otherwise seems like it should be fine :)


TEST_COMMAND = 'NODE_ENV=test jp-runner --config jp-runner.config.mjs --webpack-config webpack.config.cjs'

# TODO: Yarn can't find this package: @rolemodel/jasmine-playwright-runner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/RoleModel/jasmine-playwright-runner/pkgs/npm/jasmine-playwright-runner

It's an internal package that requires some config. Presumably anyone that's running this generator should have that key.

Maybe instead of removing this dependency, we could check for the presence of this key/ENV variable, and add it to the array if it's available? (Or maybe this generator raises if the key doesn't exist, since I think the whole point is to install that one dependency?)

Copy link
Member Author

@OutlawAndy OutlawAndy Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wesrich. Would you mind pairing with me on implementing the check you're describing? I don't know what configuration I was expected to have in place and yarn only reported the package not being found.

I feel like the tests should confirm that it works, given the proper credentials.. But maybe it's not worth the GHA configuration that would require.. Opinion?

Copy link
Member Author

@OutlawAndy OutlawAndy Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wesrich I couldn't find any solid documentation on what is required to access our private packages. I found a reference to ENV['GITHUB_PACKAGE_TOKEN'] in the L.CAD Academy repo, so that's my best guess and I've updated the generator accordingly.. 🤷‍♂️

@OutlawAndy OutlawAndy requested a review from wesrich October 9, 2025 00:30
@OutlawAndy OutlawAndy merged commit 19d203e into master Oct 9, 2025
2 checks passed
@Jeremy-Walton Jeremy-Walton deleted the consistant-test-setup branch November 13, 2025 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants