Read Eightfold career sites through the PCSX search
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bd4121be91
commit
85bfe62fec
4 files changed
+550
No files matched your search
+41
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"status": 200,
|
||||
"error": {
|
||||
"message": "",
|
||||
"body": ""
|
||||
},
|
||||
"data": {
|
||||
"id": 563121777283313,
|
||||
"displayJobId": "791521",
|
||||
"name": "Sr. Demand and S&OP Manager",
|
||||
"locations": [
|
||||
"Plano,Texas,United States",
|
||||
"Boise,Idaho,United States"
|
||||
],
|
||||
"standardizedLocations": [
|
||||
"Plano, TX, US",
|
||||
"Boise, ID, US"
|
||||
],
|
||||
"postedTs": 1790365020,
|
||||
"stars": 0,
|
||||
"department": "83 Supply & Logistics",
|
||||
"creationTs": 1789917546,
|
||||
"jobDescription": "<div><div style=\"padding: 10px 0px;border: 1px solid transparent;\"><div style=\"font-size:16px;word-wrap: break-word;\"><h2 style=\"font-size: 1em; margin: 0px\">Join our Team</h2>\r</div><div><p><strong>About this opportunity:</strong></p><p> </p><ul style=\"list-style-type: disc;\"><li><strong>Job Locations: Plano, TX or Boise, ID</strong></li><li><em>Ericsson Enterprise Wireless Solutions Inc. does not sponsor U.S work authorizations for this job positionincluding U.S. immigration filings for initial and/or change of employer paperwork for H-1’s, H-1B1’s, E-3’s, O-1’s, and TN’s. Ericsson also does not hire F-1’s working on CPT or EAD for this position. </em></li></ul><p> </p><p>Ericsson Enterprise Wireless Solutions is a team of authentic, hard-working, and innovative peopledriven by a shared vision to Connect Beyond the limits of wired networks. We help customers —big and small, across industries and around the world — utilize LTE and 5G cellular technology toconnect people, places, and things, anywhere. We’re at the forefront of the Wireless WAN and 5G —the next big waves in networking — and we remain as hungry and humble as the day we started. Ifyou’re hungry to be part of something big, come join us. </p><p> </p><p><strong>How Will You Contribute to the Company? </strong></p><p>The Sr. Demand Architect is responsible for creating an accurate and achievable collaborativeconsensus plan in close partnership with Sales, Product Management, and Finance. This keyposition must be able to facilitate and drive results in a fast-paced and demanding growthenvironment, leveraging his/her strong interpersonal and leadership skills. Additionally, theDemand Planner plays a critical role in the monthly S&OP process and will be the key resource forall demand-related issues. This role will be challenged to continue the development of bestpractices and standardized processes.</p></div></div><div style=\"padding: 10px 0px;border: 1px solid transparent;\"><div style=\"font-size:16px;word-wrap: break-word;\"><h2 style=\"font-size: 1em; margin: 0px\">What you will do</h2>\r</div><div><p><strong>Forecasting</strong></p><ul style=\"list-style-type: disc;\"><li>Manage demand planning and forecasting for purchasing to ensure an uninterrupted supply ofproducts for global customers</li><li>Partner with Sales and Marketing to understand historical sales, market trends, seasonality,product mix, sales events, marketing promotions, and other factors which influence theforecast</li><li>Manage key stakeholders by communicating realistic and accurate demand plans based onstatistical modeling</li><li>Drive consensus between cross-functional groups and leaders.</li><li>Effectively identify demand patterns, changes in trend, and drivers of product demand</li><li>Develop and drive continuous improvements to forecasting models, demand forecastingtechniques, and methods by performing root-cause analysis</li><li>Successfully identify risks and opportunities in the demand plan, escalates and communicatesappropriately</li><li>Work with Supply Planning and Sales stakeholders to shape demand and optimize businessperformance</li><li>Provide quantitative analysis that drives forecast and volatility improvements across thebusiness</li><li>Facilitate regular reviews of forecast accuracy results across the business</li><li>Effectively adapt communication of data, insights, statistical modeling, and market trends tovarious audiences</li><li>Utilize best practices in technology and processes to enable an effective demand planningfunction </li></ul></div></div><div style=\"padding: 10px 0px;border: 1px solid transparent;\"><div style=\"font-size:12px;word-wrap: break-word;\"><h2 style=\"font-size: 1em; margin: 0px\">S&OP</h2>\r</div><div><ul style=\"list-style-type: disc;\"><li>Manage the global S&OP demand process for all products in collaboration with Sales, Finance &Supply Chain</li><li>Collaborate across the organization to ensure that the appropriate data is available andaccurate to be reviewed at the S&OP process meetings</li><li>Prepare all data and metrics for demand-related S&OP meetings and reviews. Identify gapsand scenarios that will be presented. Guide final decision-making on open items includingtrade-offs and risk mitigation proposals</li><li>Provide ad hoc analysis to support decision-making by Supply Chain, Operations, Finance,Sales, Marketing, and Executive leadership </li></ul><p><strong>NPI</strong></p><ul style=\"list-style-type: disc;\"><li>SKU level demand planning to incorporate weekly and monthly reporting of key performanceindicators for the product transitions by collaborating with Product Management, Engineering,and Supply Planning leadership</li><li>Collaborate with cross-functional teams, and monitor progress of product milestones for on-time completion. Drive continuous improvement in processes</li><li>Develop internal tools to make SKU transitiLine truncated
|
||||
"location": "Plano,Texas,United States",
|
||||
"isHot": 1,
|
||||
"workLocationOption": "onsite",
|
||||
"locationFlexibility": null,
|
||||
"atsJobId": "791521",
|
||||
"positionUrl": "/careers/job/563121777283313",
|
||||
"publicUrl": "https://jobs.ericsson.com/careers/job/563121777283313",
|
||||
"jdHighlight": [],
|
||||
"positionUserActions": {
|
||||
"isSaved": false,
|
||||
"applyAction": {
|
||||
"status": "link_off",
|
||||
"applyUrl": "https://career2.successfactors.eu/career?company=Ericsson&career_ns=job_application&src=Eightfold&career_job_req_id=791521"
|
||||
}
|
||||
}
|
||||
},
|
||||
"metadata": null
|
||||
}
|
||||
Vendored
+145
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"status": 200,
|
||||
"error": {
|
||||
"message": "",
|
||||
"body": ""
|
||||
},
|
||||
"data": {
|
||||
"positions": [
|
||||
{
|
||||
"id": 563121777024688,
|
||||
"displayJobId": "788936",
|
||||
"name": "Systems Architect - RAN Semantic Data",
|
||||
"locations": [
|
||||
"Stockholm,Stockholm,Sweden"
|
||||
],
|
||||
"standardizedLocations": [
|
||||
"Stockholm, Stockholm County, SE"
|
||||
],
|
||||
"postedTs": 1790703782,
|
||||
"solrScore": null,
|
||||
"stars": 0,
|
||||
"department": "76 Product Development",
|
||||
"creationTs": 1785822052,
|
||||
"isHot": 0,
|
||||
"workLocationOption": "onsite",
|
||||
"locationFlexibility": null,
|
||||
"atsJobId": "788936",
|
||||
"positionUrl": "/careers/job/563121777024688",
|
||||
"efcustomTextJobfuntionAdvancefilterpcs": [
|
||||
"Product Development"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 563121777269700,
|
||||
"displayJobId": "791400",
|
||||
"name": "Director of Operations Excellence",
|
||||
"locations": [
|
||||
"Mexico City,Mexico City,Mexico"
|
||||
],
|
||||
"standardizedLocations": [
|
||||
"México D.F., CDMX, MX"
|
||||
],
|
||||
"postedTs": 1790703449,
|
||||
"solrScore": null,
|
||||
"stars": 0,
|
||||
"department": "82 Service Delivery",
|
||||
"creationTs": 1789700838,
|
||||
"isHot": 0,
|
||||
"workLocationOption": "onsite",
|
||||
"locationFlexibility": null,
|
||||
"atsJobId": "791400",
|
||||
"positionUrl": "/careers/job/563121777269700",
|
||||
"efcustomTextJobfuntionAdvancefilterpcs": [
|
||||
"Service Delivery"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 563121776511927,
|
||||
"displayJobId": "786802",
|
||||
"name": "SMA Production Quality Engineer",
|
||||
"locations": [
|
||||
"Lewisville,Texas,United States"
|
||||
],
|
||||
"standardizedLocations": [
|
||||
"Lewisville, TX, US"
|
||||
],
|
||||
"postedTs": 1790701576,
|
||||
"solrScore": null,
|
||||
"stars": 0,
|
||||
"department": "83 Supply & Logistics",
|
||||
"creationTs": 1781768740,
|
||||
"isHot": 0,
|
||||
"workLocationOption": "onsite",
|
||||
"locationFlexibility": null,
|
||||
"atsJobId": "786802",
|
||||
"positionUrl": "/careers/job/563121776511927",
|
||||
"efcustomTextJobfuntionAdvancefilterpcs": [
|
||||
"Supply & Logistics"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 563121776553428,
|
||||
"displayJobId": "786911",
|
||||
"name": "Product Quality Leader",
|
||||
"locations": [
|
||||
"Lewisville,Texas,United States"
|
||||
],
|
||||
"standardizedLocations": [
|
||||
"Lewisville, TX, US"
|
||||
],
|
||||
"postedTs": 1790701145,
|
||||
"solrScore": null,
|
||||
"stars": 0,
|
||||
"department": "83 Supply & Logistics",
|
||||
"creationTs": 1782032961,
|
||||
"isHot": 0,
|
||||
"workLocationOption": "onsite",
|
||||
"locationFlexibility": "flexible_within_country",
|
||||
"atsJobId": "786911",
|
||||
"positionUrl": "/careers/job/563121776553428",
|
||||
"efcustomTextJobfuntionAdvancefilterpcs": [
|
||||
"Supply & Logistics"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 563121776667313,
|
||||
"displayJobId": "787350",
|
||||
"name": "PMO Intern",
|
||||
"locations": [
|
||||
"Tecnoparque,Mexico City,Mexico",
|
||||
"Santa Fe,Mexico City,Mexico",
|
||||
"Mexico City,Mexico City,Mexico",
|
||||
"Tlalnepantla,Estado de México,Mexico"
|
||||
],
|
||||
"standardizedLocations": [
|
||||
"México D.F., CDMX, MX",
|
||||
"México D.F., CDMX, MX",
|
||||
"México D.F., CDMX, MX",
|
||||
"Tlalnepantla de Baz, Méx., MX"
|
||||
],
|
||||
"postedTs": 1790699151,
|
||||
"solrScore": null,
|
||||
"stars": 0,
|
||||
"department": "82 Service Delivery",
|
||||
"creationTs": 1782910047,
|
||||
"isHot": 0,
|
||||
"workLocationOption": "onsite",
|
||||
"locationFlexibility": null,
|
||||
"atsJobId": "787350",
|
||||
"positionUrl": "/careers/job/563121776667313",
|
||||
"efcustomTextJobfuntionAdvancefilterpcs": [
|
||||
"Service Delivery"
|
||||
]
|
||||
}
|
||||
],
|
||||
"count": 637,
|
||||
"sortBy": "timestamp",
|
||||
"appliedFilters": {},
|
||||
"resultsMetaData": {
|
||||
"usedFuzzSearch": false,
|
||||
"mocTitle": null
|
||||
}
|
||||
},
|
||||
"metadata": null
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
"""The Eightfold host module against a saved page of Ericsson's search (five
|
||||
of its roles) and one saved role answer. No network."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from app.jobs import discover # noqa: E402
|
||||
from plugins import ats, atshosts # noqa: E402
|
||||
from plugins.atshosts import eightfold # noqa: E402
|
||||
|
||||
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
|
||||
SLUG = "jobs.ericsson.com/ericsson.com"
|
||||
|
||||
|
||||
def _saved() -> dict[str, Any]:
|
||||
return json.loads((FIXTURES / "eightfold.json").read_text())
|
||||
|
||||
|
||||
def _position(n: int) -> dict[str, Any]:
|
||||
return {"id": 5000 + n, "displayJobId": str(n), "name": f"Role {n}",
|
||||
"locations": ["Lund,Skane,Sweden"], "postedTs": 1790000000 - n,
|
||||
"department": "76 Product Development", "workLocationOption": "hybrid",
|
||||
"positionUrl": f"/careers/job/{5000 + n}"}
|
||||
|
||||
|
||||
def _search(total: int, seen: list[str] | None = None) -> httpx.MockTransport:
|
||||
"""A search that ignores `num` and answers ten roles from `start`."""
|
||||
def handler(request: httpx.Request) -> httpx.Response:
|
||||
if seen is not None:
|
||||
seen.append(str(request.url))
|
||||
start = int(request.url.params["start"])
|
||||
positions = [_position(n) for n in range(start, min(start + 10, total))]
|
||||
return httpx.Response(200, json={"status": 200, "data": {
|
||||
"positions": positions, "count": total}})
|
||||
return httpx.MockTransport(handler)
|
||||
|
||||
|
||||
def test_a_page_becomes_rows() -> None:
|
||||
rows = eightfold.rows(_saved()["data"]["positions"], SLUG)
|
||||
assert len(rows) == 5
|
||||
first, mexico, many = rows[0], rows[1], rows[4]
|
||||
assert first["source_id"] == "563121777024688"
|
||||
assert first["title"] == "Systems Architect - RAN Semantic Data"
|
||||
assert first["url"] == "https://jobs.ericsson.com/careers/job/563121777024688"
|
||||
assert first["location"] == "Stockholm, Sweden" # the city is its own region
|
||||
assert first["department"] == "76 Product Development"
|
||||
assert first["posted"] == datetime.fromtimestamp(1790703782, tz=UTC)
|
||||
assert first["remote"] == "onsite" and (first["description"], first["salary_text"]) == ("", "")
|
||||
assert mexico["location"] == "Mexico City, Mexico"
|
||||
assert many["location"] == ("Tecnoparque, Mexico City, Mexico; Santa Fe, Mexico City, Mexico; "
|
||||
"Mexico City, Mexico; Tlalnepantla, Estado de México, Mexico")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("option", "remote"), [
|
||||
("onsite", "onsite"), ("hybrid", "hybrid"), ("remote", "remote"), (None, None), ("odd", None)])
|
||||
def test_the_work_location_option_maps_to_the_remote_words(
|
||||
option: str | None, remote: str | None) -> None:
|
||||
assert eightfold.rows([_position(1) | {"workLocationOption": option}], SLUG)[0]["remote"] == remote
|
||||
|
||||
|
||||
def test_a_position_without_a_name_an_id_or_a_path_is_left_out() -> None:
|
||||
bad = [_position(1) | {"name": " "}, _position(2) | {"id": None},
|
||||
_position(3) | {"positionUrl": ""}, _position(4) | {"positionUrl": "//evil.example/x"}]
|
||||
assert eightfold.rows(bad, SLUG) == []
|
||||
|
||||
|
||||
def test_the_standardized_location_stands_in_when_there_is_no_raw_one() -> None:
|
||||
row = eightfold.rows([_position(1) | {"locations": [], "standardizedLocations": ["Lund, SE"]}],
|
||||
SLUG)[0]
|
||||
assert row["location"] == "Lund, SE"
|
||||
|
||||
|
||||
def test_a_page_asks_for_the_newest_first_from_its_offset() -> None:
|
||||
asked: list[str] = []
|
||||
|
||||
def get(url: str, **_: Any) -> bytes:
|
||||
asked.append(url)
|
||||
return json.dumps(_saved()).encode()
|
||||
|
||||
decoded, results, total, cursor = eightfold.page(get, SLUG, None)
|
||||
assert asked == ["https://jobs.ericsson.com/api/pcsx/search?domain=ericsson.com"
|
||||
"&sort_by=timestamp&start=0"]
|
||||
assert (len(decoded), len(results), total, cursor) == (5, 5, 637, 5)
|
||||
assert eightfold.page(get, SLUG, 630)[3] == 635
|
||||
assert asked[-1].endswith("&start=630")
|
||||
|
||||
|
||||
def test_a_board_is_read_ten_at_a_time_to_its_total(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(ats, "PAGE_DELAY", 0)
|
||||
seen: list[str] = []
|
||||
with httpx.Client(transport=_search(25, seen)) as client:
|
||||
rows, complete = ats._fetch_rows(client, f"eightfold:{SLUG}")
|
||||
assert (len(rows), complete) == (25, True)
|
||||
assert [u.rsplit("=", 1)[1] for u in seen] == ["0", "10", "20"]
|
||||
|
||||
|
||||
def test_a_board_over_the_page_cap_is_incomplete(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""The cap is 100 pages of ten: a board of 1,292 (Infineon's) or 2,319
|
||||
(Microsoft's) is read as its first thousand and never as the whole."""
|
||||
monkeypatch.setattr(ats, "PAGE_DELAY", 0)
|
||||
seen: list[str] = []
|
||||
with httpx.Client(transport=_search(1292, seen)) as client:
|
||||
rows, complete = ats._fetch_rows(client, "eightfold:infineon.eightfold.ai/infineon.com")
|
||||
assert (len(rows), complete) == (1000, False) and len(seen) == ats.MAX_PAGES == 100
|
||||
|
||||
|
||||
def test_an_empty_board_is_complete_at_zero(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
with httpx.Client(transport=_search(0)) as client:
|
||||
assert ats._fetch_rows(client, f"eightfold:{SLUG}") == ([], True)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("body", [
|
||||
b"<html>Not found</html>", b"[]", b'{"status": 403, "message": "Not authorized for PCSX"}',
|
||||
b'{"data": {"positions": null}}'])
|
||||
def test_an_answer_that_is_not_a_search_raises(body: bytes) -> None:
|
||||
with pytest.raises(ValueError):
|
||||
eightfold.page(lambda url, **_: body, SLUG, None)
|
||||
|
||||
|
||||
def test_detail_reads_the_text_of_the_ad() -> None:
|
||||
asked: list[str] = []
|
||||
|
||||
def get(url: str, **_: Any) -> bytes:
|
||||
asked.append(url)
|
||||
return (FIXTURES / "eightfold-detail.json").read_bytes()
|
||||
|
||||
found = eightfold.detail(get, SLUG, {"source_id": "563121777283313"})
|
||||
assert asked == ["https://jobs.ericsson.com/api/pcsx/position_details"
|
||||
"?position_id=563121777283313&domain=ericsson.com&hl=en"]
|
||||
assert set(found) <= set(ats.DETAIL_FIELDS)
|
||||
text = found["description"]
|
||||
assert text.startswith("Join our Team")
|
||||
assert "<" not in text and "&" not in text and "\r" not in text and " " not in text
|
||||
|
||||
|
||||
@pytest.mark.parametrize("body", [b"<html></html>", b"[]", b'{"data": {}}'])
|
||||
def test_detail_refuses_an_answer_that_is_not_a_position(body: bytes) -> None:
|
||||
with pytest.raises(ValueError):
|
||||
eightfold.detail(lambda url, **_: body, SLUG, {"source_id": "1"})
|
||||
|
||||
|
||||
@pytest.mark.parametrize("role", ["", "12a", "1&domain=evil.example", "../x", "1 2"])
|
||||
def test_detail_refuses_an_id_that_is_not_a_number(role: str) -> None:
|
||||
def get(url: str, **_: Any) -> bytes:
|
||||
raise AssertionError("no request may be made")
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
eightfold.detail(get, SLUG, {"source_id": role})
|
||||
|
||||
|
||||
def test_the_slug_the_urls_and_the_allow_list() -> None:
|
||||
for slug in (SLUG, "infineon.eightfold.ai/infineon.com", "Apply.Careers.Microsoft.com/microsoft.com"):
|
||||
assert eightfold.slug_ok(slug) and ats.is_known_target(f"eightfold:{slug}")
|
||||
assert eightfold.careers_url("Jobs.Ericsson.com/ericsson.com") == "https://jobs.ericsson.com/careers"
|
||||
assert eightfold.robots_page(SLUG) == "https://jobs.ericsson.com/careers"
|
||||
allow = eightfold.allowed("Jobs.Ericsson.com/ericsson.com")
|
||||
assert allow("jobs.ericsson.com") and allow("JOBS.ERICSSON.COM")
|
||||
assert not allow("ericsson.com") and not allow("evil.example")
|
||||
assert not allow("jobs.ericsson.com.evil.example") and not allow("localhost")
|
||||
assert atshosts.HOSTS["eightfold"] is eightfold and ats.HOSTS["eightfold"] == "Eightfold"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("slug", [
|
||||
"", "jobs.ericsson.com", "jobs.ericsson.com/", "/ericsson.com", "jobs.ericsson.com/ericsson",
|
||||
"jobs.ericsson.com/ericsson.com/", "jobs.ericsson.com/ericsson.com/x", "a/b/c.com",
|
||||
"a@b.com/ericsson.com", "a.com#x/ericsson.com", "a.com?x/ericsson.com", "../ericsson.com",
|
||||
"a.com%2fx/b.com", "a.com:443/b.com", "a.com/b.com:80", " a.com/b.com", "a.com/b.com ",
|
||||
"a.com/b.com\n", "a.com/b.com\r\n", "127.0.0.1/ericsson.com", "a.com/127.0.0.1",
|
||||
"localhost/ericsson.com", "a.com/localhost", "a.com/b.com&start=9", "a.com/b.com?x=1",
|
||||
"[::1]/a.com", "a.com/b.com#", "app.localhost/a.com", "printer.local/a.com",
|
||||
"meta.internal/a.com", "a.com/x.internal", "a_b.com/c.com", "évil.com/a.com"])
|
||||
def test_a_hostile_slug_is_refused(slug: str) -> None:
|
||||
assert not eightfold.slug_ok(slug)
|
||||
assert not ats.is_known_target(f"eightfold:{slug}")
|
||||
|
||||
|
||||
def test_discovery_reads_the_host_and_domain_from_a_link_that_has_both() -> None:
|
||||
page = ('<a href="https://infineon.eightfold.ai/careers?domain=infineon.com&start=0">Jobs</a>'
|
||||
'<a href="https://acme.eightfold.ai/careers">no domain</a>')
|
||||
found = [(h, s) for h, s, _ in discover.boards_in(page)]
|
||||
assert ("eightfold", "infineon.eightfold.ai/infineon.com") in found
|
||||
assert ("eightfold", "") in found
|
||||
assert "eightfold" not in {h for h, _ in discover._UNREADABLE if h not in atshosts.HOSTS}
|
||||
Reference in new issue
Block a user