Giter Site home page Giter Site logo

[proposal] basic ci about nu_scripts HOT 8 CLOSED

 avatar commented on May 21, 2024
[proposal] basic ci

from nu_scripts.

Comments (8)

 avatar commented on May 21, 2024 1

Sounds great!

And then we need to get nushell somehow in the CI and run the self-contained scripts looking for failures.

Random but I recently implemented nu scripting in a project so I can provide one answer to this question.
In an Alpine edge environment:

apk add nushell --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted

I needed to use alpine:edge because of nushell's git dependency.

from nu_scripts.

fdncred avatar fdncred commented on May 21, 2024

I'm fine with a two phased approach.
Phase 1: Add scripts
Phase 2: CI

I'm just not sure what we can test. I'm not sure I care about extra spaces. I mean, it would be nice to trim the lines of trailing whitespace but I'm not sure it's critical.

I'd really like to test every script so that when CI fails, we know that nushell changed. For instance, recently we changed count to length. Those scripts that still have count should fail on the latest main. But we can't test all scripts. Maybe we should just have a test suite file where we add particular files to one master file that can be tested without outside intervention?

from nu_scripts.

fdncred avatar fdncred commented on May 21, 2024

I also like your idea to give credit where it's due on one-liners. Good job!

from nu_scripts.

 avatar commented on May 21, 2024

I mean, it would be nice to trim the lines of trailing whitespace but I'm not sure it's critical.

Agreed. I seek out errant whitespace to remove it. So entirely personal.

But we can't test all scripts. Maybe we should just have a test suite file where we add particular files to one master file that can be tested without outside intervention?

This is a great point.
I think establishing what we can test and how is critical.
It seems to me that two broad categories emerge for oneliners: self-contained and those with external dependencies.

I also feel like that connects to the problem of scripts for learning and teaching versus those for experts who know what they are looking at.

If we establish a convention for learning oneliners, we could better test them.

Maybe we should just have a test suite file where we add particular files to one master file that can be tested without outside intervention?

I love the idea to collect them into one so we can test and do more things with them.
But I would prefer a way to codify this by where we put the script or some kind of opt-in annotation in a comment.

from nu_scripts.

fdncred avatar fdncred commented on May 21, 2024

I love the idea to collect them into one so we can test and do more things with them.
But I would prefer a way to codify this by where we put the script or some kind of opt-in annotation in a comment.

I'm open to ideas but I was thinking something like text files.

self-contained.txt

script1.nu
script2.nu
script3.nu

external.txt

script4.nu
script5.nu
script6.nu

And then we need to get nushell somehow in the CI and run the self-contained scripts looking for failures.
The external scripts could be tested via a container given we have the necessary requirements like input.json or some_databaseor whatever, but that may be too big of a leap.

I prefer starting very simple and then submitting PRs over time to add complexity where it's necessary.

from nu_scripts.

 avatar commented on May 21, 2024

I noticed some scripts are marked as executable and others are not.
Perhaps we could consider linting that user-facing scripts are marked as executable.

from nu_scripts.

fdncred avatar fdncred commented on May 21, 2024

@efx i'm on windows and none of them are marked as executable since that isn't a thing. :) For *nix I'm happy to accept a PR that does that or linting as you suggest.

from nu_scripts.

 avatar commented on May 21, 2024

@fdncred ah, thanks for noting that; corrects my perspective on whether it is worth pursuing. My *nix bias creeping in 😄.

from nu_scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.