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

Improvements to Location service #248

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

daniel-de-vera
Copy link
Contributor

This PR:

  • Implements the create and delete locations endpoints.
  • Makes the logic more resilient to the Table 'location.locations' doesn't exist" error (which happen whenever the mysql pod get recreated).
  • Upgrades go from 1.21 to 1.22.

FYI, I'm planning to tag this version as e2e-v2.8 and use it in our e2e tests.
This allows running a signadot test like this (where the target vs the sandbox requests won't match but will be paired):

def nonce(prefix):
	return prefix+random.randstr("abcdefghijklmnopqrstuvwxyz", 8)


def generateLocation():
    return {
        "name": nonce("Office "),
        "coordinates": str(random.randint(-90,90)) +","+ str(random.randint(-180,180))
    }


def createLocation(loc):
    res = http.post("http://location.hotrod-devmesh:8081/location", json_body=loc, capture=True, name="createLocation")
    return res.json()["id"]


def deleteLocation(id):
    params = {
        "locationID": str(id)
    }
    http.delete("http://location.hotrod-devmesh:8081/location", params=params, capture=True, name="deleteLocation")


def test():
    loc = generateLocation()
    print("The location="+ json.dumps(loc) +" was generated")

    locID = createLocation(loc)
    print("The locationID="+ str(locID) +" was created")

    deleteLocation(locID)
    print("The locationID="+ str(locID) +" was deleted")

test()

Copy link

github-actions bot commented Sep 26, 2024

Location Test Results

3 tests   2 ✅  2s ⏱️
2 suites  1 💤
2 files    0 ❌

Results for commit a54ddcb.

♻️ This comment has been updated with latest results.

Copy link

Location Sandbox Ready!
https://app.signadot.com/sandbox/name/pr-248-location

Copy link
Member

@scott-cotton scott-cotton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daniel-de-vera daniel-de-vera merged commit 6f11672 into main Sep 27, 2024
8 checks passed
@daniel-de-vera daniel-de-vera deleted the create-delete-locations branch September 27, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants