KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Academy Advanced Capstone 3.2 and 3.6 tests failing

  • Advanced Capstone 3.2 and 3.6 tests failing

    Posted by tanaymathur on December 3, 2023 at 12:00 am

    Hi,

    I have completed all the exercises for the advanced capstone final project and can individually run and test all the required functions. But while running the tests for section 3, tests for 3.2 and one of the tests for 3.6 are failing. Can you please advise what is causing the tests to fail even though I can run them manually and can see the results?

    quizItem success description error 
    ------------------------------------------------------------------------------------------------------------------ 
    exercise3.2 Fail "abort" "abort in before block due to error "password"" 
    exercise3.3 Pass ".perm.users should exist on HDB process" "" 
    exercise3.4 Pass "define .z.pw on HDB process" "" 
    exercise3.4 Pass "give access to users with correct password" "" 
    exercise3.4 Pass "give access to users with wrong password" "" 
    exercise3.5 Pass "return first element of parse tree" "" 
    exercise3.5 Pass "return ! if given update query" "" 
    exercise3.6 Pass "define .z.pg on remote process" "" 
    exercise3.6 Fail "fiauser can run one function" "sensor" 
    exercise3.6 Pass "fiauser cant run tables[]" "" 
    exercise3.6 Pass "team members can run any function" ""
    tanaymathur replied 3 months, 1 week ago 2 Members · 7 Replies
  • 7 Replies
  • megan_mcp

    Administrator
    December 4, 2023 at 12:00 am

    Hi ,

    The issue is that you haven’t loaded the f1 database on port 5099,  which might explain why when you run the tests for 3.6, which includes testing that fiauser can run the function getSummaryReport[], you are getting a the sensor error as sensor does not exist on port 5099.

    If you load in the f1 database, the error should be resolved.

    Thanks,

    Megan

    • tanaymathur

      Member
      December 4, 2023 at 12:00 am

      Thanks Megan. I was able to run the tests after loading the databse and got the certificate

  • megan_mcp

    Administrator
    December 4, 2023 at 12:00 am

    Hi ,

    Can you send your code for these exercises using the spoiler tag?

    Thanks,

    Megan

    • tanaymathur

      Member
      December 4, 2023 at 12:00 am

      Hi Megan,

      Please find the code below.

      Best Regards,

      Tanay

      //3.2
      .perm.users:("S*S";enlist " ") 0: `$"../AdvancedCapstone.Data/users.txt"
      .perm.users:1!(update password:{.Q.sha1 x}each password from .perm.users)
      hdbH(set;`.perm.parseQuery;.perm.parseQuery)
      
      // 3.6
      hdbH".z.pg:{permission:.perm.users[.z.u;`api];test:.perm.parseQuery[x];$[permission~`all;value x;($[test~permission;value x;:`notAuthorized])]}"

       

      • tanaymathur

        Member
        December 4, 2023 at 12:00 am

        Hi Megan,

        I restarted the workspace again and redefined .z.pg as below which sorted out 3.2 but 3.6 is still getting error

         

        hdbH".z.pg:{ user:.z.u;permission:.perm.users[user;`api];test:.perm.parseQuery[x];$[permission~`all;value x;($[test~permission;value x;:`notAuthorized])]}"

         

         

  • megan_mcp

    Administrator
    December 4, 2023 at 12:00 am

    Hi ,

    Can I ask you to send me your code for 3.1?

    Thanks,

    Megan

    • tanaymathur

      Member
      December 4, 2023 at 12:00 am

      sure. Here it is

      // 3.1
      hdbH:hopen`::5099

Log in to reply.