Closed Bug 1627024 Opened 5 months ago Closed 4 months ago

Set up FOG Rust testing

Categories

(Toolkit :: Telemetry, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: chutten, Assigned: chutten)

References

Details

(Whiteboard: [telemetry:fog:m3])

Attachments

(1 file, 2 obsolete files)

In this bug we'll add a rust test in the FOG integration layer and ensure it runs as part of the rusttest build variants on try. That should remove the final barrier preventing us from adding tests when we add implementation to FOG.

According to the Oxidation FAQ:

Mozilla crates can be tested with cargo test by adding them to RUST_TESTS in toolkit/library/rust/moz.build.

Depends on D69449

Hm.

So we have a bit of a problem. FOG uses some gecko symbols (unsurprisingly, as interfacing between gecko and Glean is FOG's raison d'etre), and gecko symbols appear to be unavailable in the rusttests task. Linux can get around that by not caring whether a symbol is present if it's not used, but Windows cares much more about that.

ni?lina do you know (or know someone who knows) whether this is a problem that could/should/can be solved? Could/should/can we add Gecko symbols to rusttests? Or will we be forced to write our own test harness and expose it to gtest so it can be run : (

Flags: needinfo?(lina)

It looks like Stylo ran into the same problem; check out this comment and the GitHub comment it links to, as well as bug 1373878, comment 33 and bug 1373878, comment 59. Seems like the easiest way to work around this is to disable tests on Windows entirely for now. ☹️

CCing :froydnj just in case, but he's out 'til next month.

Flags: needinfo?(lina)
Depends on: 1628074

A chat with rstewart yesterday resulted in bug 1628074 which hopefully will unblock us here.

To broaden on the point, FOG is an integration layer between Firefox and Glean and thus will have a bunch of code that uses Gecko symbols. We need some way to test that code and are kinda hoping that rusttests will be the way forward. The Stylo method of only running on Linux won't work for that code.

Attachment #9137866 - Attachment is obsolete: true
Attachment #9138024 - Attachment is obsolete: true

Given the result of bug 1628074 we're gonna set our sights a little lower here. We're going to write a simple "this doesn't crash" test for our only foreign function fog_init and document the procedure and limitations (e.g. rust gtests can only test at the FFI).

Later we might figure out a way to generate C bindings for any functions we wish to test (looking at you, cbindgen) so we can test with impunity... but for now let's test this one thing.

Also document the state of FOG testing at the present time.

Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/20a4d1902d33
Add a rust gtest for FOG r=janerik
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Regressions: 1634344
You need to log in before you can comment on or make changes to this bug.