diff --git a/apps/nextpath/README.md b/apps/nextpath/README.md index f1fc7cf..871377d 100644 --- a/apps/nextpath/README.md +++ b/apps/nextpath/README.md @@ -35,21 +35,19 @@ writes a mode-0600 pre-deploy backup under `/data/homelab-nextpath/backups`. ## Enable the Arizona employability outlook -College Scorecard completion data is public. Projected openings and current -postings use the official CareerOneStop API, which requires a free API user ID -and token. Supply them only for the first deployment (or when rotating them): +Jeannie retrieves all three inputs from public, read-only sources that require +no user or operator account: College Scorecard for annual completions, +Projections Central for Arizona annual openings, and Ayla's public government +hiring feed for a current Arizona posting snapshot. + +Deploy normally: ```bash -read -r -p "CareerOneStop user ID: " career_user -read -r -s -p "CareerOneStop API token: " career_token; echo -LAB_NEXTPATH_CAREERONESTOP_USER_ID="$career_user" \ -LAB_NEXTPATH_CAREERONESTOP_API_TOKEN="$career_token" \ - ./jeannie deploy-nextpath -unset career_user career_token +./jeannie deploy-nextpath ``` -Jeannie stores the values in private mode-0600 files, refreshes evidence once -immediately, and installs a daily systemd timer. Later deployments reuse the -private credentials and the last successful evidence snapshot. Neither values -nor raw source responses are exposed to browsers. +Deployment refreshes evidence and enables a daily systemd timer. Refreshes are +atomic; a source failure preserves the last successful snapshot. Operators can +run `./jeannie nextpath status` or `./jeannie nextpath refresh`. There are no +prompts, tokens, or browser-side source credentials. diff --git a/apps/nextpath/data/soc-cip-map.json b/apps/nextpath/data/soc-cip-map.json index c23e34f..b2ef414 100644 --- a/apps/nextpath/data/soc-cip-map.json +++ b/apps/nextpath/data/soc-cip-map.json @@ -2,17 +2,17 @@ "version": "nextpath-soc-cip-2026-01", "source_url": "https://nces.ed.gov/ipeds/cipcode/resources.aspx?y=56", "mappings": { - "15-1252.00": {"cip4": ["1107"], "coverage": 0.8}, - "29-1141.00": {"cip4": ["5138"], "coverage": 0.9}, - "47-2111.00": {"cip4": ["4603"], "coverage": 0.8}, - "49-9021.00": {"cip4": ["4702"], "coverage": 0.8}, - "25-2021.00": {"cip4": ["1312"], "coverage": 0.7}, - "27-1024.00": {"cip4": ["5004"], "coverage": 0.7}, - "13-2011.00": {"cip4": ["5203"], "coverage": 0.9}, - "17-2051.00": {"cip4": ["1408"], "coverage": 0.9}, - "35-1011.00": {"cip4": ["1205"], "coverage": 0.7}, - "21-1012.00": {"cip4": ["1311", "4407"], "coverage": 0.6}, - "13-1081.00": {"cip4": ["5202"], "coverage": 0.7}, - "29-1292.00": {"cip4": ["5106"], "coverage": 0.9} + "15-1252.00": {"cip4": ["1107"], "coverage": 0.8, "job_query": "software developer"}, + "29-1141.00": {"cip4": ["5138"], "coverage": 0.9, "job_query": "registered nurse"}, + "47-2111.00": {"cip4": ["4603"], "coverage": 0.8, "job_query": "electrician"}, + "49-9021.00": {"cip4": ["4702"], "coverage": 0.8, "job_query": "HVAC technician"}, + "25-2021.00": {"cip4": ["1312"], "coverage": 0.7, "job_query": "elementary teacher"}, + "27-1024.00": {"cip4": ["5004"], "coverage": 0.7, "job_query": "graphic designer"}, + "13-2011.00": {"cip4": ["5203"], "coverage": 0.9, "job_query": "accountant auditor"}, + "17-2051.00": {"cip4": ["1408"], "coverage": 0.9, "job_query": "civil engineer"}, + "35-1011.00": {"cip4": ["1205"], "coverage": 0.7, "job_query": "chef head cook"}, + "21-1012.00": {"cip4": ["1311", "4407"], "coverage": 0.6, "job_query": "career counselor"}, + "13-1081.00": {"cip4": ["5202"], "coverage": 0.7, "job_query": "logistics"}, + "29-1292.00": {"cip4": ["5106"], "coverage": 0.9, "job_query": "dental hygienist"} } } diff --git a/cmd/jeannie-server/main.go b/cmd/jeannie-server/main.go index 221433b..cd52140 100644 --- a/cmd/jeannie-server/main.go +++ b/cmd/jeannie-server/main.go @@ -61,6 +61,7 @@ var allowedCommands = map[string]bool{ "deploy-ai-tools": true, "deploy-omniroute": true, "deploy-hermes": true, "rpi-services": true, "host-bootstrap": true, "bootstrap-gitea-repo": true, "repo-sync": true, "backup-gitea": true, "hermes-connect": true, "network-sandbox": true, + "nextpath": true, "backup": true, "drill-restore": true, "drill-gitea-restore": true, "drill-pihole-restore": true, "install-gitea-runner": true, "move-prometheus-stack-workers": true, "doctor-versions": true, diff --git a/cmd/nextpath/internal/opportunity/outlook.go b/cmd/nextpath/internal/opportunity/outlook.go index a09fc38..5f59e08 100644 --- a/cmd/nextpath/internal/opportunity/outlook.go +++ b/cmd/nextpath/internal/opportunity/outlook.go @@ -78,7 +78,7 @@ func Calculate(evidence Evidence) (Outlook, error) { Confidence: confidence, Limitations: []string{ "Rough market estimate—not your chance of being hired.", - "Current postings are a changing snapshot and include varying experience levels.", + "Current postings are a changing sample of government and official hiring sources, not the whole Arizona market.", "Graduates may enter other occupations, and workers may enter without a mapped Arizona program.", }, Evidence: evidence, diff --git a/cmd/nextpath/internal/web/templates.go b/cmd/nextpath/internal/web/templates.go index d5b6f7c..ff7f182 100644 --- a/cmd/nextpath/internal/web/templates.go +++ b/cmd/nextpath/internal/web/templates.go @@ -24,4 +24,4 @@ const loginPage = `{{define "content"}}

Continue exploring.

What sounds interesting, {{.Name}}?

Rate the activity itself—not whether you are already good at it.

{{.Answered}} of {{.Total}} answered

{{.Question.Prompt}}

{{range $value := seq}}{{end}}
Not interestedUnsureVery interested
{{end}}` -const resultsPage = `{{define "content"}}

Your current interest profile

Hello {{.Name}}. Your three-letter exploration code is {{.Result.Code}}.

{{range .Result.Scores}}
{{.Dimension}}
{{.Percent}}%
{{end}}

Careers to explore next

Interest fit and Arizona market outlook are separate signals. The market percentage is a rough demand-to-completions comparison, not your probability of being hired.

{{range .Matches}}
O*NET-SOC {{.Occupation.ONETSOC}} · interest fit {{.FitScore}}%

{{.Occupation.Title}}

{{.Occupation.Summary}}

{{.Reason}}

{{if .Outlook}}
Arizona employability outlook: {{.Outlook.EmployabilityOutlookPercent}}%

{{.Outlook.Label}} · {{.Outlook.Confidence}} evidence confidence

{{.Outlook.Evidence.ArizonaProjectedOpenings}} projected openings/year and {{.Outlook.Evidence.ActivePostings}} current postings observed, compared with {{.Outlook.Evidence.ArizonaAnnualGraduates}} recent Arizona completions. Demand-to-completions ratio: {{.Outlook.AnnualDemandToGraduateRatio}}.

Formula: 75% projected annual demand coverage + 25% current posting coverage. Postings include varying experience levels. Snapshot {{.Outlook.Evidence.PostingsObservedAt.Format "Jan 2, 2006"}}.

{{else}}

Arizona employability outlook unavailable. Complete source evidence has not been refreshed for this occupation; no percentage is estimated.

{{end}}

Try it first: {{.Occupation.TryFirst}}

Review the O*NET occupation profile
{{end}}

How to use this

{{.Result.InstrumentNotice}}

Confidence: {{.Result.Confidence}}. This describes interests, not ability or identity. Market outlook is contextual evidence, not a hiring promise.

Export my data

Delete account

{{end}}` +const resultsPage = `{{define "content"}}

Your current interest profile

Hello {{.Name}}. Your three-letter exploration code is {{.Result.Code}}.

{{range .Result.Scores}}
{{.Dimension}}
{{.Percent}}%
{{end}}

Careers to explore next

Interest fit and Arizona market outlook are separate signals. The market percentage is a rough demand-to-completions comparison, not your probability of being hired.

{{range .Matches}}
O*NET-SOC {{.Occupation.ONETSOC}} · interest fit {{.FitScore}}%

{{.Occupation.Title}}

{{.Occupation.Summary}}

{{.Reason}}

{{if .Outlook}}
Arizona employability outlook: {{.Outlook.EmployabilityOutlookPercent}}%

{{.Outlook.Label}} · {{.Outlook.Confidence}} evidence confidence

{{.Outlook.Evidence.ArizonaProjectedOpenings}} projected openings/year and {{.Outlook.Evidence.ActivePostings}} sampled current postings, compared with {{.Outlook.Evidence.ArizonaAnnualGraduates}} recent Arizona completions. Demand-to-completions ratio: {{.Outlook.AnnualDemandToGraduateRatio}}.

Formula: 75% projected annual demand coverage + 25% current posting coverage. The posting sample covers government and official hiring sources, not the whole Arizona market. Snapshot {{.Outlook.Evidence.PostingsObservedAt.Format "Jan 2, 2006"}}.

{{else}}

Arizona employability outlook unavailable. Complete source evidence has not been refreshed for this occupation; no percentage is estimated.

{{end}}

Try it first: {{.Occupation.TryFirst}}

Review the O*NET occupation profile
{{end}}

How to use this

{{.Result.InstrumentNotice}}

Confidence: {{.Result.Confidence}}. This describes interests, not ability or identity. Market outlook is contextual evidence, not a hiring promise.

Export my data

Delete account

{{end}}` diff --git a/docs/nextpath-architecture.md b/docs/nextpath-architecture.md index 5455e3d..9bc1050 100644 --- a/docs/nextpath-architecture.md +++ b/docs/nextpath-architecture.md @@ -85,16 +85,17 @@ from: - BLS OEWS wage and employment data; - College Scorecard field-of-study data; - Arizona CTE and registered apprenticeship directories; -- CareerOneStop job search. +- Ayla's public feed of government and official-source job postings. Remote source data is cached with retrieval timestamps and source attribution. Job listings are short-lived examples, are linked to their publisher, and do not become training data or evidence of guaranteed employment. -Jeannie refreshes the cache daily from the public College Scorecard API and -CareerOneStop. The latter requires a private API user ID and bearer token. -They are stored as mode `0600` files outside release directories and are never -sent to the browser. A refresh replaces the cache atomically only after every +Jeannie refreshes the cache daily without credentials or prompts. It combines +the public College Scorecard API, Department of Labor-sponsored Projections +Central state projections, and Ayla's public feed of government and official +hiring sources. The posting count is therefore a visible sample, not the whole +Arizona job market. A refresh replaces the cache atomically only after every catalog occupation has all three inputs; failures preserve the last successful snapshot. With no complete snapshot, the results page says the outlook is unavailable rather than presenting a synthetic percentage. diff --git a/jeannie b/jeannie index 92615f6..f7d8790 100755 --- a/jeannie +++ b/jeannie @@ -84,6 +84,7 @@ Build And Bootstrap deploy-miniflux Deploy Debian-hosted private RSS reader. deploy-opsproof Build and deploy the Debian-hosted OpsProof UI. deploy-nextpath Build and deploy the Debian-hosted NextPath WIP. + nextpath {refresh|status} Refresh or inspect NextPath's public labor-data cache. deploy-dex Deploy the Debian-hosted Dex SSO stack. monitoring {plan|migrate|apply|refresh|exporters|status|validate} Manage Debian monitoring; preserve cluster discovery and Dex. deploy-office Deploy Nextcloud + ONLYOFFICE online office. @@ -721,6 +722,9 @@ case "${1:-}" in record_change_journal "deploy-nextpath" "$@" deploy_nextpath ;; + nextpath) + nextpath_action "$@" + ;; deploy-dex) record_change_journal "deploy-dex" "$@" deploy_dex diff --git a/lib/jeannie/pipeline.sh b/lib/jeannie/pipeline.sh index 570a6f7..1b9b0a6 100644 --- a/lib/jeannie/pipeline.sh +++ b/lib/jeannie/pipeline.sh @@ -6011,6 +6011,41 @@ UNIT_EOF echo "OpsProof Laravel Go shell and PostgreSQL service are healthy at http://${bind_ip}:${http_port}/." } +nextpath_action() { + local action="${1:-status}" + local install_dir="${LAB_NEXTPATH_INSTALL_DIR:-/data/homelab-nextpath}" + local opportunity_store="${install_dir}/data/opportunity.json" + + require_debian_server "nextpath ${action}" + case "${action}" in + refresh) + sudo systemctl start nextpath-opportunity-refresh.service + echo "NextPath labor evidence refreshed." + ;; + status) + if sudo test -s "${opportunity_store}"; then + sudo python3 - "${opportunity_store}" <<'PY' +import json +import sys + +with open(sys.argv[1], encoding="utf-8") as stream: + data = json.load(stream) +print(f"evidence generated: {data.get('generated_at', 'unknown')}") +print(f"occupations: {len(data.get('occupations', {}))}") +PY + else + echo "evidence: no successful snapshot" + fi + sudo systemctl is-enabled nextpath-opportunity-refresh.timer 2>/dev/null || true + sudo systemctl is-active nextpath-opportunity-refresh.timer 2>/dev/null || true + ;; + *) + echo "Usage: ./jeannie nextpath {refresh|status}" >&2 + return 2 + ;; + esac +} + deploy_nextpath() { local install_dir="${LAB_NEXTPATH_INSTALL_DIR:-/data/homelab-nextpath}" local http_port="${LAB_NEXTPATH_HTTP_PORT:-8892}" @@ -6024,9 +6059,6 @@ deploy_nextpath() { local backup_dir="${install_dir}/backups" local backup_timestamp="" local opportunity_store="${install_dir}/data/opportunity.json" - local credential_dir="${install_dir}/credentials" - local career_user_file="${credential_dir}/careeronestop-user-id" - local career_token_file="${credential_dir}/careeronestop-token" local elapsed=0 require_debian_server "deploy-nextpath" @@ -6056,21 +6088,9 @@ deploy_nextpath() { release_id="$(git -C "${REPO_ROOT}" rev-parse --verify HEAD)" release_dir="${install_dir}/releases/${release_id}" sudo install -d -o "${service_user}" -g "${service_user}" -m 0750 \ - "${install_dir}" "${install_dir}/releases" "${install_dir}/data" "${backup_dir}" "${credential_dir}" + "${install_dir}" "${install_dir}/releases" "${install_dir}/data" "${backup_dir}" sudo chmod 0700 "${install_dir}/data" sudo chmod 0700 "${backup_dir}" - sudo chmod 0700 "${credential_dir}" - - if [[ -n "${LAB_NEXTPATH_CAREERONESTOP_USER_ID:-}" || -n "${LAB_NEXTPATH_CAREERONESTOP_API_TOKEN:-}" ]]; then - if [[ -z "${LAB_NEXTPATH_CAREERONESTOP_USER_ID:-}" || -z "${LAB_NEXTPATH_CAREERONESTOP_API_TOKEN:-}" ]]; then - echo "Both LAB_NEXTPATH_CAREERONESTOP_USER_ID and LAB_NEXTPATH_CAREERONESTOP_API_TOKEN are required." >&2 - return 1 - fi - printf '%s' "${LAB_NEXTPATH_CAREERONESTOP_USER_ID}" | sudo tee "${career_user_file}" >/dev/null - printf '%s' "${LAB_NEXTPATH_CAREERONESTOP_API_TOKEN}" | sudo tee "${career_token_file}" >/dev/null - sudo chown "${service_user}:${service_user}" "${career_user_file}" "${career_token_file}" - sudo chmod 0600 "${career_user_file}" "${career_token_file}" - fi # The initial manual-preview instructions used the install root. Migrate # that file once, without ever replacing a store already managed by the @@ -6117,7 +6137,7 @@ Type=oneshot User=${service_user} Group=${service_user} WorkingDirectory=${install_dir}/current -ExecStart=/usr/bin/python3 ${install_dir}/current/scripts/nextpath-opportunity-refresh.py --mapping ${install_dir}/current/data/soc-cip-map.json --output ${opportunity_store} --user-id-file ${career_user_file} --token-file ${career_token_file} +ExecStart=/usr/bin/python3 ${install_dir}/current/scripts/nextpath-opportunity-refresh.py --mapping ${install_dir}/current/data/soc-cip-map.json --output ${opportunity_store} NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict @@ -6166,21 +6186,16 @@ ReadWritePaths=${install_dir}/data WantedBy=multi-user.target UNIT_EOF sudo systemctl daemon-reload - if sudo test -s "${career_user_file}" && sudo test -s "${career_token_file}"; then - if ! sudo systemctl start nextpath-opportunity-refresh.service; then - if sudo test -s "${opportunity_store}"; then - echo "Warning: NextPath evidence refresh failed; preserving the last successful snapshot." >&2 - else - echo "NextPath evidence refresh failed and no prior snapshot is available." >&2 - sudo journalctl -u nextpath-opportunity-refresh.service -n 50 --no-pager >&2 || true - return 1 - fi + if ! sudo systemctl start nextpath-opportunity-refresh.service; then + if sudo test -s "${opportunity_store}"; then + echo "Warning: NextPath evidence refresh failed; preserving the last successful snapshot." >&2 + else + echo "NextPath evidence refresh failed and no prior snapshot is available." >&2 + sudo journalctl -u nextpath-opportunity-refresh.service -n 50 --no-pager >&2 || true + return 1 fi - sudo systemctl enable --now nextpath-opportunity-refresh.timer - else - sudo systemctl disable --now nextpath-opportunity-refresh.timer >/dev/null 2>&1 || true - echo "NextPath labor refresh is waiting for private CareerOneStop credentials; existing evidence cache was preserved." fi + sudo systemctl enable --now nextpath-opportunity-refresh.timer sudo systemctl enable nextpath.service sudo systemctl restart nextpath.service diff --git a/scripts/nextpath-opportunity-refresh.py b/scripts/nextpath-opportunity-refresh.py index 0657d23..51c9d1d 100644 --- a/scripts/nextpath-opportunity-refresh.py +++ b/scripts/nextpath-opportunity-refresh.py @@ -20,13 +20,12 @@ from pathlib import Path from typing import Any SCORECARD_URL = "https://api.data.gov/ed/collegescorecard/v1/schools.json" -CAREERONESTOP = "https://api.careeronestop.org" +PROJECTIONS_CENTRAL = "https://public.projectionscentral.org/Projections/LongTermRestJson" +AYLA_JOBS = "https://aylagov.com/api/jobs/search" -def get_json(url: str, token: str = "", timeout: int = 45) -> dict[str, Any]: +def get_json(url: str, timeout: int = 45) -> dict[str, Any]: headers = {"Accept": "application/json", "User-Agent": "NextPath/1.0"} - if token: - headers["Authorization"] = f"Bearer {token}" with urllib.request.urlopen(urllib.request.Request(url, headers=headers), timeout=timeout) as response: return json.load(response) @@ -69,41 +68,36 @@ def annual_completions(programs: Iterable[dict[str, Any]], cip4: set[str]) -> in def projected_openings(body: dict[str, Any]) -> tuple[int, str]: - details = body.get("OccupationDetail") or [] - if not details: - raise ValueError("CareerOneStop returned no occupation details") - projections = details[0].get("Projections") or {} - rows = projections.get("Projections") or [] - row = next((item for item in rows if item.get("StateName") == "Arizona"), rows[0] if rows else None) + rows = body.get("rows") or [] + row = next((item for item in rows if item.get("Area") == "Arizona"), rows[0] if rows else None) if not row: - raise ValueError("CareerOneStop returned no Arizona projection") - count = int(str(row.get("ProjectedAnnualJobOpening", "0")).replace(",", "")) - period = f"{row.get('EstimatedYear', projections.get('EstimatedYear', ''))}-{row.get('ProjectedYear', projections.get('ProjectedYear', ''))}" + raise ValueError("Projections Central returned no Arizona projection") + count = int(str(row.get("AvgAnnualOpenings", "0")).replace(",", "")) + period = f"{row.get('BaseYear', '')}-{row.get('ProjYear', '')}" return count, period.strip("-") -def career_one_stop(user_id: str, token: str, onet: str) -> tuple[int, str, int]: - path = "/".join(urllib.parse.quote(part, safe="") for part in (user_id, onet, "AZ")) - details = get_json( - f"{CAREERONESTOP}/v1/occupation/{path}?projectedEmployment=true&enableMetaData=true", - token, - ) - openings, period = projected_openings(details) - job_path = "/".join(urllib.parse.quote(str(part), safe="") for part in ( - user_id, onet, "AZ", 0, 0, 0, 0, 1, 30, - )) - jobs = get_json(f"{CAREERONESTOP}/v2/jobsearch/{job_path}?enableMetaData=true", token) - return openings, period, int(jobs.get("TotalJobCount", 0)) +def public_market_evidence(onet: str, job_query: str) -> tuple[int, str, int]: + soc = onet.split(".", 1)[0] + projections = get_json(f"{PROJECTIONS_CENTRAL}/04/{urllib.parse.quote(soc, safe='-')}") + openings, period = projected_openings(projections) + query = urllib.parse.urlencode({ + "search": job_query, + "limit": 1, + "filters": json.dumps({"state": "AZ"}, separators=(",", ":")), + }) + jobs = get_json(f"{AYLA_JOBS}?{query}") + return openings, period, int(jobs.get("pagination", {}).get("total", 0)) -def refresh(mapping_path: Path, output_path: Path, user_id: str, token: str, api_key: str) -> None: +def refresh(mapping_path: Path, output_path: Path, api_key: str) -> None: mapping = json.loads(mapping_path.read_text()) programs = scorecard_programs(api_key) observed = datetime.now(timezone.utc) occupations: dict[str, Any] = {} for onet, spec in mapping["mappings"].items(): graduates = annual_completions(programs, set(spec["cip4"])) - openings, period, postings = career_one_stop(user_id, token, onet) + openings, period, postings = public_market_evidence(onet, spec["job_query"]) if graduates <= 0: raise ValueError(f"no Arizona completions found for {onet}") occupations[onet] = { @@ -116,8 +110,8 @@ def refresh(mapping_path: Path, output_path: Path, user_id: str, token: str, api "geography": "Arizona", "soc_to_cip_mapping_coverage": spec["coverage"], "graduate_source_url": "https://collegescorecard.ed.gov/data/", - "projection_source_url": "https://api.careeronestop.org/api-explorer/home/index/Occupations_GetOccupationDetails", - "posting_source_url": "https://api.careeronestop.org/api-explorer/home/index/JobSearchV2_GetJobsByKeywordAndOnetCode", + "projection_source_url": "https://projectionscentral.org/directdownloads", + "posting_source_url": "https://aylagov.com/developers", } payload = { "version": "nextpath-opportunity-cache-v1", @@ -142,19 +136,9 @@ def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--mapping", type=Path, required=True) parser.add_argument("--output", type=Path, required=True) - parser.add_argument("--user-id", default=os.environ.get("CAREERONESTOP_USER_ID", "")) - parser.add_argument("--token", default=os.environ.get("CAREERONESTOP_API_TOKEN", "")) - parser.add_argument("--user-id-file", type=Path) - parser.add_argument("--token-file", type=Path) parser.add_argument("--data-gov-key", default=os.environ.get("DATA_GOV_API_KEY", "DEMO_KEY")) args = parser.parse_args() - if args.user_id_file: - args.user_id = args.user_id_file.read_text().strip() - if args.token_file: - args.token = args.token_file.read_text().strip() - if not args.user_id or not args.token: - parser.error("CareerOneStop user ID and API token are required") - refresh(args.mapping, args.output, args.user_id, args.token, args.data_gov_key) + refresh(args.mapping, args.output, args.data_gov_key) if __name__ == "__main__": diff --git a/tests/jeannie/test_nextpath_opportunity_refresh.py b/tests/jeannie/test_nextpath_opportunity_refresh.py index c98cba6..dc5e344 100644 --- a/tests/jeannie/test_nextpath_opportunity_refresh.py +++ b/tests/jeannie/test_nextpath_opportunity_refresh.py @@ -22,12 +22,10 @@ class NextPathOpportunityRefreshTests(unittest.TestCase): self.assertEqual(MODULE.annual_completions(programs, {"1107"}), 15) def test_extracts_arizona_projection(self): - body = {"OccupationDetail": [{"Projections": { - "EstimatedYear": "2022", "ProjectedYear": "2032", "Projections": [ - {"StateName": "Arizona", "ProjectedAnnualJobOpening": "1,234", "EstimatedYear": "2022", "ProjectedYear": "2032"} - ] - }}]} - self.assertEqual(MODULE.projected_openings(body), (1234, "2022-2032")) + body = {"rows": [{ + "Area": "Arizona", "AvgAnnualOpenings": "1,234", "BaseYear": "2024", "ProjYear": "2034" + }]} + self.assertEqual(MODULE.projected_openings(body), (1234, "2024-2034")) if __name__ == "__main__": diff --git a/tests/jeannie/test_nextpath_pipeline.py b/tests/jeannie/test_nextpath_pipeline.py index 2494d04..77aea57 100644 --- a/tests/jeannie/test_nextpath_pipeline.py +++ b/tests/jeannie/test_nextpath_pipeline.py @@ -17,8 +17,10 @@ class NextPathPipelineTests(unittest.TestCase): self.assertIn("NEXTPATH_ACCOUNT_STORE=${account_store}", pipeline) self.assertIn("NEXTPATH_OPPORTUNITY_STORE=${opportunity_store}", pipeline) self.assertIn("nextpath-opportunity-refresh.timer", pipeline) - self.assertIn("LAB_NEXTPATH_CAREERONESTOP_API_TOKEN", pipeline) - self.assertIn("--token-file ${career_token_file}", pipeline) + self.assertIn("nextpath_action()", pipeline) + self.assertNotIn("CareerOneStop API token", pipeline) + self.assertNotIn("--token-file", pipeline) + self.assertIn("Projections Central", (ROOT / "scripts/nextpath-opportunity-refresh.py").read_text()) self.assertLess( pipeline.index("systemctl start nextpath-opportunity-refresh.service"), pipeline.index("systemctl restart nextpath.service"), @@ -37,7 +39,9 @@ class NextPathPipelineTests(unittest.TestCase): self.assertIn('curl -fsS --connect-timeout 3 "http://127.0.0.1:${http_port}/healthz"', pipeline) self.assertIn("nextpath.service", pipeline) self.assertIn("deploy-nextpath)", command) + self.assertIn("nextpath)", command) self.assertIn('"deploy-nextpath": true', server) + self.assertIn('"nextpath":', server) def test_inventory_declares_public_wip(self): inventory = (ROOT / "homelab.yml").read_text(encoding="utf-8")