nixos/tests/glitchtip: test sourcemap uploads
This commit is contained in:
@@ -42,7 +42,9 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript =
|
||||||
|
{ nodes, ... }: # python
|
||||||
|
''
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
@@ -99,5 +101,14 @@ in
|
|||||||
assert len(resp) == 1
|
assert len(resp) == 1
|
||||||
assert resp[0]["title"] == "hello world"
|
assert resp[0]["title"] == "hello world"
|
||||||
assert int(resp[0]["count"]) == 1
|
assert int(resp[0]["count"]) == 1
|
||||||
|
|
||||||
|
# create api token
|
||||||
|
csrf_token = machine.succeed(f"grep csrftoken {cookie_jar_path} | cut -f7").rstrip()
|
||||||
|
resp = json.loads(machine.succeed(f"{curl} {origin_url}/api/0/api-tokens/ -s -H 'X-Csrftoken: {csrf_token}' -H 'Content-Type: application/json' -d '{{\"label\":\"token\",\"scopes\":[\"project:write\"]}}'"))
|
||||||
|
token = resp["token"]
|
||||||
|
|
||||||
|
# upload sourcemaps
|
||||||
|
machine.succeed(f"sentry-cli --url {origin_url} --auth-token {token} sourcemaps upload --org main --project test ${nodes.machine.services.glitchtip.package.frontend}/*.map")
|
||||||
|
assert machine.succeed("ls /var/lib/glitchtip/uploads/file_blobs/").strip()
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user