This repository was archived by the owner on Sep 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +59
-7
lines changed
Expand file tree Collapse file tree 3 files changed +59
-7
lines changed Original file line number Diff line number Diff line change 1+ name : Test all modules E2E
2+ on :
3+ - push
4+
5+ env :
6+ CURRENT_WORKING_ENGINE_COMMIT : f30e8f5c9829c017deaa319e29449e10fa88971b
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-20.04
11+ steps :
12+ # Checkout registry repo
13+ - name : Checkout registry Repo
14+ uses : actions/checkout@v4
15+ with :
16+ path : opengb-registry
17+
18+ # Get engine repo to test against
19+ - name : Fetch engine repo
20+ uses : actions/checkout@v4
21+ with :
22+ repository : rivet-gg/opengb
23+ ssh-key : ${{ secrets.GH_DEPLOY_KEY }}
24+ path : opengb
25+
26+ - name : Checkout to working commit
27+ run : cd opengb/ && git checkout $CURRENT_WORKING_ENGINE_COMMIT
28+
29+ # Install Deno to run OpenGB
30+ - name : Install Deno
31+ uses : denoland/setup-deno@v1
32+ with :
33+ deno-version : " 1.41.1"
34+
35+ - name : Install OpenGB
36+ run : cd opengb/ && deno task cli:install
37+
38+ - name : Setup OpenGB databases for registry
39+ run : cd ./opengb-registry/tests/test_project && opengb db dev
40+
41+ - name : Run Tests for all modules
42+ run : cd ./opengb-registry/tests/test_project && opengb test
Original file line number Diff line number Diff line change @@ -34,23 +34,23 @@ test(
3434test (
3535 "validate token expired" ,
3636 async ( ctx : TestContext ) => {
37- const { token } = await ctx . call ( " tokens" , " create" , {
37+ const { token } = await ctx . modules . tokens . create ( {
3838 type : "test" ,
3939 meta : { foo : "bar" } ,
40- expireAt : new Date ( Date . now ( ) + 100 ) . toISOString ( ) ,
41- } ) as any ;
40+ expireAt : new Date ( Date . now ( ) + 1000 ) . toISOString ( ) ,
41+ } ) ;
4242
4343 // Token should be valid
44- let validateRes = await ctx . call ( " tokens" , " validate" , {
44+ const validateRes = await ctx . modules . tokens . validate ( {
4545 token : token . token ,
46- } ) as any ;
46+ } ) ;
4747 assertEquals ( token . id , validateRes . token . id ) ;
4848
4949 // Wait for token to expire
50- await new Promise ( ( resolve ) => setTimeout ( resolve , 200 ) ) ;
50+ await new Promise ( ( resolve ) => setTimeout ( resolve , 1100 ) ) ;
5151
5252 const error = await assertRejects ( async ( ) => {
53- await ctx . call ( " tokens" , " validate" , { token : token . token } ) as any ;
53+ await ctx . modules . tokens . validate ( { token : token . token } ) ;
5454 } , RuntimeError ) ;
5555 assertEquals ( error . code , "TOKEN_EXPIRED" ) ;
5656 } ,
Original file line number Diff line number Diff line change 1+ registries :
2+ default :
3+ local :
4+ directory : ../../modules
5+ modules :
6+ currency : {}
7+ friends : {}
8+ rate_limit : {}
9+ tokens : {}
10+ users : {}
You can’t perform that action at this time.
0 commit comments