Giter VIP home page Giter VIP logo

Comments (6)

LukeSavefrogs avatar LukeSavefrogs commented on May 30, 2024

Hi @mh21,
I suspect this has to do with the way your project folder is structured.

From the documentation:

This is the typical directory structure. Version 0.28.0 allows many of these to be changed by specifying options, supporting a more flexible directory structure.

<PROJECT-ROOT> directory
├─ .shellspec                       [mandatory]
├─ .shellspec-local                 [optional] Ignore from version control
├─ .shellspec-quick.log             [optional] Ignore from version control
├─ report/                          [optional] Ignore from version control
├─ coverage/                        [optional] Ignore from version control
│
├─ bin/
│   ├─ your_script1.sh
│              :
├─ lib/
│   ├─ your_library1.sh
│              :
│
├─ spec/ (also <HELPERDIR>)
│   ├─ spec_helper.sh               [recommended]
│   ├─ banner[.md]                  [optional]
│   ├─ support/                     [optional]
│   │
│   ├─ bin/
│   │   ├─ your_script1_spec.sh
│   │             :
│   ├─ lib/
│   │   ├─ your_library1_spec.sh

As you can see, the spec directory should be under the <PROJECT-ROOT> directory, whereas yours is inside the bin (in your case program1) folder.
What you did is NOT a workaround, you just used the correct folder structure. 😃

Typically i use this structure:

<PROJECT-ROOT> directory
├─ spec/
│   ├─ test.spec.sh
├─ src/
│   ├─ mycode.sh
├─ .shellspec
├─ README.md

Solution n.1

If what you're trying topull off is a monorepo continue doing as you did in your "workaround".

Each new folder containing a new sub-project (i.e. program1) should have its own .shellspec file.

Solution n.2 (couldn't test)

If you really really need the original project structure (with only one .shellspec file at the top) try to explicitly pass the test folder to shellspec:

shellspec --kcov program1/spec/

from shellspec.

mh21 avatar mh21 commented on May 30, 2024

Just for some context, this is from https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests. It is a repository of kernel tests used by Red Hat kernel QE. Different directories are different kernel tests, and having the spec directory (for testing the tests 🙈) next to the actual kernel tests makes a lot of sense for the QE folks that are individually only concerned with a subset of the kernel tests directories.

from shellspec.

LukeSavefrogs avatar LukeSavefrogs commented on May 30, 2024

Just for some context, this is from https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests. It is a repository of kernel tests used by Red Hat kernel QE. Different directories are different kernel tests, and having the spec directory (for testing the tests 🙈) next to the actual kernel tests makes a lot of sense for the QE folks that are individually only concerned with a subset of the kernel tests directories.

WHAT?

Red Hat uses shellspec???

This is news to me!


However... How did you manage to use kcov?
I couldn't reproduce the bug since i can't install it 😞

Did you build it from source?

I'm using Windows 10 with WSL2.

from shellspec.

mh21 avatar mh21 commented on May 30, 2024

We started to use it in the CKI team (https://cki-project.org) which takes care of the Red Hat kernel CI infrastucture. And we are really really happy with it 🤗.

Examples: https://gitlab.com/cki-project/pipeline-definition/-/tree/main/spec

We run kcov in a Fedora Core container, e.g. via registry.gitlab.com/cki-project/cki-tools/cki-tools:production (which has shellspec/kcov already installed, https://gitlab.com/cki-project/containers/-/blob/main/includes/snippet-shellspec is what gets pulled into our Dockerfiles). My WSL2 skills are pretty rusty, so I'm not sure about the current way to run containers there 🙈.

from shellspec.

mh21 avatar mh21 commented on May 30, 2024

Thank you for your explanation! I'll close this issue, as it seems to be a problem on our end 🙈.

from shellspec.

LukeSavefrogs avatar LukeSavefrogs commented on May 30, 2024

Thank you for your explanation! I'll close this issue, as it seems to be a problem on our end 🙈.

Happy you were able to solve😄

What was the problem (if could be useful)?

from shellspec.

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.