Commit Graph

74 Commits

Author SHA1 Message Date
fang
bf64e94ca3
tests: expand eyre eauth tests
For the server case, we add tests for http-first finalization, incorrect
eauth tokens, attempt expiration, client abort signalling, and client
deletion requests.

For the client case, we add a test for approving eauth attempts without
being locally authenticated.

To this end, we refactor the layout of the eauth tests. The +eauth core
now contains the tasks/gifts to be handled by the client/server, but no
longer does move checking. This happens within the test arms only. This
way, we may trivially re-run parts of the eauth flow under different
conditions.
2023-05-23 20:32:24 +02:00
fang
a6acfe3c93
tests: add based happy-path eauth tests 2023-05-19 19:25:04 +02:00
fang
3347e84811
eyre: rename authentication-state to auth
Only in the $server-state type, the lull typename remains unchanged (for
now). "authentication-state" is just such a mouthful!
2023-05-19 11:32:07 +02:00
fang
dd41df7d7c
tests: make eyre tests build & succeed again 2023-05-19 11:09:11 +02:00
fang
b8ff52d79a
tests: remove trailing whitespace in eyre tests 2023-05-16 21:47:23 +02:00
fang
637992475b
eyre: refactor guest name generation
Concatenating before we truncate, instead of truncating the entropy by
itself, is slightly simpler.

Because this slightly changes the naming algorithm, we must update the
eyre tests to match.
2023-05-16 21:46:48 +02:00
Philip Monk
c3dc248b30 Merge remote-tracking branch 'origin/m/the-open-eyre' into philip/mare 2023-05-11 11:19:25 -07:00
fang
466fc0b63b
eyre: pass session-id+identity into auth handling
This lets it also clean up guest sessions created just for the login
request, and lets us display the current guest identity on the login
page.
2023-05-09 15:10:14 +02:00
Philip Monk
8910e12f67 eyre: refactor tests
This shaves off 1000 lines of testing code while maintaining the same
tests.  It reduces boilerplate by introducing "mare", a monad for
testing Eyre.  It's very simple (just maintains the current state of
Eyre and the current time), but it's easier to build helper functions in
this form, and that reduces the immense quantities of copy-and-paste
that were in the old tests.  What's there now could surely be improved
further, but I think this is a good start.

The underlying mare machinery is not really specific to Eyre, so it
would be straightforward to apply this strategy to other vanes.  The
work is in creating appropriate helper functions for each vane.  Eyre is
undergoing work, so that's the only one I've changed here.  Further,
it's not clear that this is the ultimate solution to unit testing vanes.
The resulting code is IMO clearer than before, but I wouldn't say it's
*clear*.
2023-05-08 20:40:28 -07:00
fang
67799c77e0
tests: update eyre tests for guest sessions
Unauthenticated requests now also create sessions. This affects most
HTTP request handling tests.

The situation here is not ideal, and worsening over time. Worth spending
some time to think about how to best refactor the Eyre tests to make
them more manageable and easier to maintain.
2023-05-08 19:10:00 +02:00
~wicrum-wicrun
99ca67db7f tests: remove defunct deq test 2023-05-02 17:02:58 +02:00
~wicrum-wicrun
6355b84d35 tests: use @uxyowl instead of @uxmeow 2023-04-24 19:56:24 +02:00
~wicrum-wicrun
738b17d0ca tests: remove .siz from $meow 2023-04-24 17:48:00 +02:00
yosoyubik
fc22926ed6 tests: fix rift/life in ames/fine tests 2023-04-23 09:40:57 +02:00
Joe Bryan
79b17f03b3 tests: shrink/silence trace hints 2023-04-23 02:02:15 -04:00
Joe Bryan
36821967be tests: fixes $wail serialization in fine tests 2023-04-23 02:01:50 -04:00
Ted Blackman
84cd948f30 Merge branch 'next/kelvin/413' into i/5788/remote-scry 2023-04-22 14:33:20 -04:00
yosoyubik
d259656e29 lull: clean up remote scry namespace missmatches
(note: first pass, subject to change)
2023-04-22 10:57:49 +02:00
Joe Bryan
3eeca101ac test: fixes ames tests (broken due to $roar refactoring) 2023-04-21 13:16:59 -04:00
yosoyubik
2bcfd7599a ames: fix %fine tests to account for updated %tune 2023-04-21 17:54:01 +02:00
~wicrum-wicrun
93e6589df2 tests: zero out signatures in fine requests 2023-04-20 19:40:07 +02:00
yosoyubik
873de61269 ames: give %miss to all listeners on %keen cancel
%spider will send a %yawn task to ames if a thread fails
or stops. if the thread is done, it will delete the scry
from its state without notifying %ames
2023-04-19 11:03:11 +02:00
Joe Bryan
2029fe7b23 tests: removes userspace deq import 2023-04-18 11:05:03 -04:00
yosoyubik
e0c0470a6e tests: fix %fine response signature validation 2023-04-18 09:12:35 +02:00
yosoyubik
07a6b2e06f tests: check CI with failing signature test
This test is failing locally but the signature comes from
+make-meow:etch-hunk:ames which should be the
expected value for the test -- compare result with CI
2023-04-18 05:33:05 +02:00
Joe Bryan
790a0de292 ames: fix move clobbering in +fi-done 2023-04-17 18:29:44 -04:00
Joe Bryan
50f5abc138 tests: removes spurious vases from %tune 2023-04-17 17:47:03 -04:00
yosoyubik
03b3d0b3f4 tests: fix /tests/sys/fine 2023-04-17 16:41:53 +02:00
yosoyubik
1d91bb5e33 ames: first pass a %fine unit tests 2023-04-17 14:15:35 +02:00
Ted Blackman
f3d2df087a
Merge pull request #6463 from ashelkovnykov/json-new
zuse: changes in preparation for JSON jets
2023-04-13 11:58:55 -04:00
fang
4bc88f2825
tests: patch eyre tests for channel modes
Since the tests call arms from eyre directly, these had to be updated
alongside it, to now specify the channel mode in light of which the
request should be parsed.

Includes smoke tests for jam-mode channels.
2023-04-12 19:33:05 +02:00
Alex Shelkovnykov
e61d84d57b Replace +en:json:html code with cord version
Encode JSON to cord instead of tape. Code copied from @joemfb 's
version.
2023-04-11 14:59:15 -06:00
Alex Shelkovnykov
ac1a0ffdee Change JSON parser arms to match |base16:html 2023-04-11 14:59:15 -06:00
Alex Shelkovnykov
345c4a8ae5 Refactor unit tests for JSON decoding/encoding
The unit tests for de-json:html and en-json:html in zuse.hoon were
copied from the JSON Test Suite (https://github.com/nst/JSONTestSuite).
While a good test suite if usable as-is, it has a lot of problems with
it, namely: inconsistent test names; repeated tests; and mixing tests
for multiple cases into one file. Since the tests need to be manually
added to Urbit anyway, this commit uses the opportunity to clean up the
test suite by making the following changes:
- Renaming tests to use a consistent naming scheme
- Removing repetetive test cases
- Splitting multi-case tests into multiple single-purpose tests
2023-04-11 14:59:15 -06:00
yosoyubik
bbbb4934b9 test: fix /sys/zuse/balk 2023-04-07 20:44:31 +02:00
yosoyubik
af050caf0f test: make /tests/sys/grq pass after remote scry
To conform with the new new fields (req and sam) in .shot
(note: it would be to have helpers that create the serialize blobs)
2023-04-07 19:13:45 +02:00
yosoyubik
5f2eb383c7 tests: make /test/sys/ames pass 2023-04-06 13:44:45 +02:00
yosoyubik
2545e05c7a lull: implement +wyt for getting the size of a |deq 2023-03-22 12:26:50 +01:00
yosoyubik
dd0f35c8ad Merge branch 'm/contdist-and-behn' into i/5788/remote-scry 2023-03-21 18:01:17 +01:00
yosoyubik
3963b0a951 ames: fix test-nack
previously we were acking the nack-trace message (adding a %send move)
before notifying the message-pump with a %near task. Now, due to the
refactoring we invert the order of those moves. This seems safe but will
determine with livenet testing
2023-02-22 14:45:44 +01:00
Ted Blackman
08abd0807b
Merge pull request #6334 from urbit/i/6333/fix-grq-test
ames: fix failing GRQ test
2023-02-17 09:12:07 -05:00
yosoyubik
12b79884e7 Merge branch 'yu/fix-grq-test' into i/6333/fix-grq-test 2023-02-16 10:01:18 +01:00
pkova
49a24647da eyre: revert inclusion of HttpOnly header for now 2023-02-13 20:58:59 +02:00
pkova
d8ff95db84 eyre: add /~/name endpoint 2023-02-13 14:26:54 +02:00
fang
92066f3a33
Merge branch 'develop' into m/http-auth-tokens 2023-02-06 19:44:01 +01:00
DaneBettis
cb1ce57475 added %meme tests to hints.hoon 2023-02-02 15:15:53 +00:00
Philip Monk
83b39e82a7 Merge remote-tracking branch 'origin/next/arvo' into m/detest 2023-01-18 18:01:59 -07:00
fang
e888960370
tests: move to root, out of pkg/arvo
Including these in pkg/arvo has caused many minor problems over the
years. We don't want to include them in releases, but this often meant
excluding them manually, which was error-prone.

Here, we move them out of /pkg/arvo/tests and into /tests. CI will have
to be updated to match, since we'll still want to include tests there.
2023-01-18 16:50:42 +01:00
benjamin-tlon
c86879e833
Nix Build + Monorepo Structure (#1196) 2019-03-04 16:43:53 -08:00
benjamin-tlon
93dbe1df26
Remove trailing whitespace and enforce in CI. (#1212) 2019-02-25 13:35:12 -08:00