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

Write Test Case For Azure cli Action #48

Merged
merged 7 commits into from
Aug 23, 2021
Merged

Conversation

PankajGovindRao
Copy link
Contributor

Test Case For Azure cli Action

@ghost
Copy link

ghost commented Aug 9, 2021

CLA assistant check
All CLA requirements met.

src/main.ts Outdated
@@ -21,15 +22,18 @@ const run = async () => {
}

let inlineScript: string = core.getInput('inlineScript', { required: true });
let azcliversion: string = core.getInput('azcliversion', { required: true }).trim().toLowerCase();

let azcliversion: string = core.getInput('azcliversion', { required: true });
Copy link
Contributor

Choose a reason for hiding this comment

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

Add .trim().toLowerCase() back

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added .trim().toLowerCase()

src/main.ts Outdated
if (!(await checkIfValidCLIVersion(azcliversion))) {
console.log("INVALID VERSION")
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this console.log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

src/main.ts Outdated
core.setFailed('Please enter a valid azure cli version. \nSee available versions: https://github.com/Azure/azure-cli/releases.');
throw new Error('Please enter a valid azure cli version. \nSee available versions: https://github.com/Azure/azure-cli/releases.')
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

src/main.ts Outdated
return;
}

if (!inlineScript.trim()) {
core.setFailed('Please enter a valid script.');
throw new Error('Please enter a valid script.')
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,47 @@
name: ci-workflow
on:
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace on with this -

on:
  push:
  schedule:
    - cron: '0 */3 * * *'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

INPUT_INLINESCRIPT: " "
EXPECTED_TO: fail
run: ts-node test/main.test.ts

Copy link
Contributor

Choose a reason for hiding this comment

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

Add post status action at the end

 - name: Post to slack on failure
        if: failure()
        uses: 8398a7/action-slack@v3.9.1
        with:
            status: ${{ job.status }}
            fields: repo,message,author,action,ref,workflow
        env:
            SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@github-actions
Copy link

This PR is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Aug 21, 2021
@t-dedah t-dedah merged commit dbebf94 into Azure:master Aug 23, 2021
t-dedah added a commit that referenced this pull request Nov 10, 2021
* Updated Readme for Azure CLI actions  (#29)

* Update README.md

* Update README.md

Co-authored-by: Usha N <n-usha@github.com>

* Add changes

* Added add-label workflow (#41)

* Added add-label workflow

* Updated default label worlkflow for health dashboard

* Reduced time

* Added issue template for health dashboard (#42)

* Added issue template for health dashboard

* Added assignees

* Add 'getting help' section to point customers to Azure CLI Repo for help (#50)

Signed-off-by: James Casey <james.casey@microsoft.com>

* Write Test Case For Azure cli Action (#48)

* Create main.test.ts

* Create ci-workflow.yml

* Update main.ts

* Update ci-workflow.yml

* Update main.ts

* Update ci-workflow.yml

* Update ci-workflow.yml

* Resolved multiple README issues (#51)

* Resolved multiple issues

* revert

* Changed default for azcliversion. (#57)

* Added restrictLatestToAgent

* typo

* required set to false

* Changed default to agent az cli version

* deleted lib files

* Resolved comments

* Add changes

* Update package.json

* Update package-lock.json

* Upgrade version (#59)

* Revert "Update package-lock.json"

This reverts commit 5633362.

* Revert "Update package.json"

This reverts commit f4b36bb.

* Upgrade version in packkage.json

Co-authored-by: Zainudeen V K <zainuvk@github.com>
Co-authored-by: Usha N <n-usha@github.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: James Casey <james.casey@microsoft.com>
Co-authored-by: PankajGovindRao <84085346+PankajGovindRao@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle Inactive for 14 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants