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

Add positive check to cFS execution in CI #56

Open
skliper opened this issue Mar 17, 2020 · 5 comments
Open

Add positive check to cFS execution in CI #56

skliper opened this issue Mar 17, 2020 · 5 comments

Comments

@skliper
Copy link
Contributor

skliper commented Mar 17, 2020

Is your feature request related to a problem? Please describe.
CI in #39 only checks for warn/err/fail in cFS output

Describe the solution you'd like
Enforce the existence of the following message:
"CFE_ES_Main entering OPERATIONAL state"

Describe alternatives you've considered
Any other positive check would work, above was the simplest I could think of.

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@jphickey
Copy link
Contributor

If the 1Hz tick and clocks are working one should also see "Stop FLYWHEEL" event from CFE_TIME approximately 2 seconds after that operational message.

But overall I would advocate a more holistic approach to sanity checking the build. For instance the latter event should be checked by subscribing to the event stream and checking for event CFE_TIME_FLY_OFF_EID. Checking the stdout for specific messages is neither reliable nor sustainable for a longer term solution.

@skliper
Copy link
Contributor Author

skliper commented Mar 17, 2020

Yeah, definitely debated internally what level to go to. Any positive check is better than none, but I agree a specific message on stdout is pretty fragile.

Certainly encourage ideas and thought about really what's useful/appropriate for this Travis CI check.

We lack documentation covering the bigger picture/goals of more sophisticated test setups like dockers emulated platforms, etc but from that perspective/context (and eventually automating build verification) maybe a non-empty file for this test is good enough (and less dependent on text changing)? I'm trying to catch the case where we get a false pass because nothing happened. I'd think it'd be sufficient to just check that something happened (and no warn/fail/err).

@lethuillierg
Copy link

It would indeed be nice to automatically check the behavior of the executable, in addition to running unit tests.

In this context, I have implemented a proof of concept consisting of a fully dockerized end-to-end automated test. In substance, this solution builds and runs the cFS (currently: on CentOS 7, Ubuntu 18.04, or Ubuntu 20.04). Simultaneously, a pseudo-GSW—in fact: a program running the test—tries to enable the telemetry of the former and, if successful, asserts that an expected event (e.g. Stop FLYWHEEL) has been emitted by the FSW. Such an assertion is performed by inspecting the datagrams sent by the FSW through the network connection, not via stdout or stderr.

When the test passes, the testing tool exits with code 0. When one modifies the cFS code to simulate an error (e.g. make the FSW not emit a Stop FLYWHEEL), the error is indeed detected by the tool, and a non-zero exit code is returned. This is shown by the following screen captures.

cfs_e2e_tool

(Note: the green and red borders are for illustrative purposes only).

In short, this prototype checks the cFS execution by simulating GSW/FSW interactions, where the GSW is, in fact, a test runner. And because the tool is fully dockerized, it would be conceivable to directly integrate it into the CI process in the future.

Obviously, this is not a full-fledged testing solution at the moment, but I think that it could help to illustrate the possibilities offered by this approach as well as concretely show its limitations and the technical challenges that it introduces.

In this context, I am wondering if it would be reasonable for me to open a pull request that would submit this tool as well as explain the underlying methodology in more detail.

@skliper
Copy link
Contributor Author

skliper commented May 6, 2020

@lethuillierg Excellent ideas, and appreciate the input! We have discussed a docker approach internally and possibly also testing for multiple platforms/OS's utilizing QEMU, eventually building up to a continuous verification system across multiple architectures. Tagging @jphickey @astrogeco and @acudmore if they have more inputs. I encourage opening a pull request!

@lethuillierg
Copy link

Thank you @skliper. I will soon open a pull request for this purpose.

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

No branches or pull requests

3 participants