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

Talent v4beta1 samples [Restoring deleted branch samples] #3273

Merged
merged 44 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fcbd9f3
restored deleted samples
munkhuushmgl Apr 3, 2020
fed3630
fixed lint issues
munkhuushmgl Apr 3, 2020
a9d5334
added tests and formatted code
munkhuushmgl Apr 23, 2020
ffa5704
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl Apr 23, 2020
2ac12c2
corrected test req.txt file
munkhuushmgl Apr 23, 2020
c05d682
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl Apr 23, 2020
6e79a1a
Merge branch 'master' into talent-v4beta1-samples
Apr 29, 2020
69a175b
made requested changes and added return val for samples
munkhuushmgl May 15, 2020
ea51187
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl May 15, 2020
84dcd99
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 15, 2020
e8a67b0
added secrets.txt to bash, script
munkhuushmgl May 15, 2020
3f28e5e
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl May 15, 2020
64f06af
fixed the lint
munkhuushmgl May 15, 2020
6f4fe16
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 15, 2020
7d22192
Merge branch 'master' into talent-v4beta1-samples
May 16, 2020
88ff29e
moved to requirements-test.txt
May 17, 2020
5340974
delete resources in teardown just in case
May 17, 2020
e454c4e
Merge branch 'master' into talent-v4beta1-samples
May 17, 2020
3a3efe9
restored deleted samples
munkhuushmgl Apr 3, 2020
ee75d23
resolved the conflicts
munkhuushmgl May 18, 2020
8974b3d
added some spacing
munkhuushmgl May 18, 2020
69d471a
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 18, 2020
b41139d
restored deleted samples
munkhuushmgl Apr 3, 2020
68c1c93
fixed merge conflicts
munkhuushmgl May 18, 2020
c44b313
fixed merge conflicts
munkhuushmgl May 18, 2020
64a71ae
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 18, 2020
ef7be49
added conftest.py and refactored samples with loop
munkhuushmgl May 19, 2020
6dd6793
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl May 19, 2020
a133f36
removed talent secret.txt from bash script
munkhuushmgl May 19, 2020
640151f
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 19, 2020
ab3bf67
fixed the lint issue
munkhuushmgl May 19, 2020
db5d438
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl May 19, 2020
72540a8
removed unnecessary env vars
munkhuushmgl May 19, 2020
489d96c
deleted global random ids, deleted unnecessary setup code from delete…
munkhuushmgl May 20, 2020
642aa6c
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 20, 2020
15ad14a
removed unused imports
munkhuushmgl May 20, 2020
55ec1cc
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl May 20, 2020
75ce337
removed pytest
munkhuushmgl May 20, 2020
e117bf4
removed unused IDs
munkhuushmgl May 20, 2020
6e05a60
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 20, 2020
7ec8505
deleted unused uuid imports
munkhuushmgl May 20, 2020
740f227
Merge branch 'talent-v4beta1-samples' of https://github.com/munkhuush…
munkhuushmgl May 20, 2020
76e3762
Merge branch 'master' into talent-v4beta1-samples
munkhuushmgl May 20, 2020
6526fbd
Merge branch 'master' into talent-v4beta1-samples
May 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed unnecessary env vars
  • Loading branch information
munkhuushmgl committed May 19, 2020
commit 72540a80b4932d01dce482ae5a3d4702810a4d92
5 changes: 2 additions & 3 deletions jobs/v4beta1/job_search_autocomplete_job_title_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import job_search_autocomplete_job_title

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]


def test_autocomplete_job_title(capsys):
job_search_autocomplete_job_title.complete_query(PROJECT_ID, TENANT_ID, "Software")
def test_autocomplete_job_title(capsys, tenant):
job_search_autocomplete_job_title.complete_query(PROJECT_ID, tenant, "Software")
out, _ = capsys.readouterr()
assert "Suggested title:" in out
9 changes: 4 additions & 5 deletions jobs/v4beta1/job_search_create_company_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
import job_search_delete_company

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]
COMPANY_EXT_ID = "COMPANY_EXT_ID_{}".format(uuid.uuid4())


def test_create_company(capsys, cleaner):
def test_create_company(capsys, tenant, cleaner):
# create company
company_name = job_search_create_company.create_company(
PROJECT_ID, TENANT_ID, "Test Company Name", COMPANY_EXT_ID
PROJECT_ID, tenant, "Test Company Name", COMPANY_EXT_ID
)
out, _ = capsys.readouterr()
assert "Created" in out
Expand All @@ -40,10 +39,10 @@ def test_create_company(capsys, cleaner):


@pytest.fixture(scope="module")
def cleaner():
def cleaner(tenant):
companies = []

yield companies

for company_id in companies:
job_search_delete_company.delete_company(PROJECT_ID, TENANT_ID, company_id)
job_search_delete_company.delete_company(PROJECT_ID, tenant, company_id)
10 changes: 4 additions & 6 deletions jobs/v4beta1/job_search_create_job_custom_attributes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
import job_search_delete_job

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]
COMPANY_ID = os.environ["JOB_SEARCH_COMPANY_ID"]
JOB_EXT_UNIQUE_ID = "TEST_JOB_{}".format(uuid.uuid4())


def test_create_job_with_attributes(capsys, cleaner):
def test_create_job_with_attributes(capsys, tenant, company, cleaner):
job_name = job_search_create_job_custom_attributes.create_job(
PROJECT_ID, TENANT_ID, COMPANY_ID, JOB_EXT_UNIQUE_ID
PROJECT_ID, tenant, company, JOB_EXT_UNIQUE_ID
)
out, _ = capsys.readouterr()
assert "Created job:" in out
Expand All @@ -39,10 +37,10 @@ def test_create_job_with_attributes(capsys, cleaner):


@pytest.fixture(scope="module")
def cleaner():
def cleaner(tenant):
jobs = []

yield jobs

for job_id in jobs:
job_search_delete_job.delete_job(PROJECT_ID, TENANT_ID, job_id)
job_search_delete_job.delete_job(PROJECT_ID, tenant, job_id)
10 changes: 4 additions & 6 deletions jobs/v4beta1/job_search_create_job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
import job_search_delete_job

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]
COMPANY_ID = os.environ["JOB_SEARCH_COMPANY_ID"]
JOB_EXT_UNIQUE_ID = "TEST_JOB_{}".format(uuid.uuid4())


def test_create_job(capsys, cleaner):
def test_create_job(capsys, tenant, company, cleaner):
# create a job
job_name = job_search_create_job.create_job(
PROJECT_ID, TENANT_ID, COMPANY_ID, JOB_EXT_UNIQUE_ID, "www.example.com"
PROJECT_ID, tenant, company, JOB_EXT_UNIQUE_ID, "www.example.com"
)
out, _ = capsys.readouterr()
assert "Created job:" in out
Expand All @@ -40,10 +38,10 @@ def test_create_job(capsys, cleaner):


@pytest.fixture(scope="module")
def cleaner():
def cleaner(tenant):
jobs = []

yield jobs

for job_id in jobs:
job_search_delete_job.delete_job(PROJECT_ID, TENANT_ID, job_id)
job_search_delete_job.delete_job(PROJECT_ID, tenant, job_id)
11 changes: 5 additions & 6 deletions jobs/v4beta1/job_search_delete_company_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
import job_search_delete_company

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]
COMPANY_EXT_ID = "COMPANY_EXT_ID_{}".format(uuid.uuid4())


@pytest.fixture(scope="module")
def company():
def company(tenant):
# create a temporary company
company_name = job_search_create_company.create_company(
PROJECT_ID, TENANT_ID, "Test Company Name", COMPANY_EXT_ID
PROJECT_ID, tenant, "Test Company Name", COMPANY_EXT_ID
)

# extract company id
Expand All @@ -40,14 +39,14 @@ def company():
yield company_id

try:
job_search_delete_company.delete_company(PROJECT_ID, TENANT_ID, company)
job_search_delete_company.delete_company(PROJECT_ID, tenant, company)
except NotFound as e:
print("Ignoring NotFound upon cleanup, details: {}".format(e))


def test_delete_company(capsys, company):
def test_delete_company(capsys, tenant, company):
out, _ = capsys.readouterr()

job_search_delete_company.delete_company(PROJECT_ID, TENANT_ID, company)
job_search_delete_company.delete_company(PROJECT_ID, tenant, company)
out, _ = capsys.readouterr()
assert "Deleted" in out
12 changes: 5 additions & 7 deletions jobs/v4beta1/job_search_delete_job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@
import job_search_delete_job

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]
COMPANY_ID = os.environ["JOB_SEARCH_COMPANY_ID"]
POST_UNIQUE_ID = "TEST_POST_{}".format(uuid.uuid4())[:20]


@pytest.fixture(scope="module")
def job():
def job(tenant, company):
# create a temporary job
job_name = job_search_create_job.create_job(
PROJECT_ID, TENANT_ID, COMPANY_ID, POST_UNIQUE_ID, "www.jobUrl.com"
PROJECT_ID, tenant, company, POST_UNIQUE_ID, "www.jobUrl.com"
)

# extract company id
Expand All @@ -41,12 +39,12 @@ def job():
yield job_id

try:
job_search_delete_job.delete_job(PROJECT_ID, TENANT_ID, job_id)
job_search_delete_job.delete_job(PROJECT_ID, tenant, job_id)
except NotFound as e:
print("Ignoring NotFound upon cleanup, details: {}".format(e))


def test_delete_job(capsys, job):
job_search_delete_job.delete_job(PROJECT_ID, TENANT_ID, job)
def test_delete_job(capsys, tenant, job):
job_search_delete_job.delete_job(PROJECT_ID, tenant, job)
out, _ = capsys.readouterr()
assert "Deleted" in out
1 change: 0 additions & 1 deletion jobs/v4beta1/job_search_get_tenant_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import job_search_get_tenant

PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TENANT_ID = os.environ["JOB_SEARCH_TENANT_ID"]


def test_get_tenant(capsys, tenant):
Expand Down