Skip to content

Conversation

savil
Copy link
Collaborator

@savil savil commented Sep 1, 2023

Summary

Motivation
The name summary for cli-tests in the Github PR page is:

test (false, ubuntu-latest, true, 2.12.0)

This isn't very helpful.

This PR:

  • removes the booleans and changes their true/false states to explicit names
  • renames devbox-json-tests to project-tests for brevity.

How was it tested?

will observe the testscripts pass...

Now, it looks like:

cli-tests / test (not-main, ubuntu-latest, project-tests, 2.12.0)

which is much more understandable.

@savil savil force-pushed the savil/improve-cli-tests branch from 21e1006 to 559150c Compare September 1, 2023 22:04
@savil savil force-pushed the savil/improve-cli-tests branch from 559150c to 8da9320 Compare September 1, 2023 22:08
@savil savil marked this pull request as ready for review September 1, 2023 22:09
Copy link
Contributor

@ipince ipince left a comment

Choose a reason for hiding this comment

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

Approving to unblock, but see comments

run-devbox-json-tests: false
- run-devbox-json-tests: true
- is-main: "is-main"
run-project-tests: "project-tests"
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be project-tests-off?

# But we allow overriding via inputs.example-debug
DEVBOX_DEBUG: ${{ (!matrix.run-devbox-json-tests || inputs.example-debug) && '1' || '0' }}
DEVBOX_RUN_DEVBOX_JSON_TESTS: ${{ matrix.run-devbox-json-tests }}
DEVBOX_DEBUG: ${{ (matrix.run-project-tests == 'not-project-tests' || inputs.example-debug) && '1' || '0' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be project-tests-off?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch!

Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

I totally agree the labels suck, but I really have trouble following our rules (Many of which I wrote myself - lol)

Alternative:

  • Create two different workflows that both call a job in a shared workflow.
  • The shared workflow takes inputs that decide what to run (what OS, and what scope of tests).

So the jobs in non-main can be named:

  • Basic tests on mac
  • All tests on linux

On main:

  • All tests on (mac|linux)

(under the hood, each of these is just calling some shared jobs in another workflow which is never triggered directly).

This should really simplify names and also remove much of the exclude logic which is hard to grok.

nix-version: ["2.12.0", "2.17.0"]
exclude:
- is-main: false
- is-main: "not-main"
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that improving the labels is good, but lines like this make my head spin :(

Copy link
Collaborator Author

@savil savil left a comment

Choose a reason for hiding this comment

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

@mikeland73 some refactoring like that seems called for. I'll circle back to doing that in a bit.

Will land this for now, so at least we get rid of boolean labels.

# But we allow overriding via inputs.example-debug
DEVBOX_DEBUG: ${{ (!matrix.run-devbox-json-tests || inputs.example-debug) && '1' || '0' }}
DEVBOX_RUN_DEVBOX_JSON_TESTS: ${{ matrix.run-devbox-json-tests }}
DEVBOX_DEBUG: ${{ (matrix.run-project-tests == 'not-project-tests' || inputs.example-debug) && '1' || '0' }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch!

@savil savil merged commit 27be737 into main Sep 5, 2023
@savil savil deleted the savil/improve-cli-tests branch September 5, 2023 17:59
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.

4 participants